Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #888406

    Hello,
    bisher hatte ich Probleme dass in der Yoast Sitemap nur ein paar meiner Images angezeigt werden.

    Jetzt habe ich bei Yoast folgende Hinweis gefunden:

    Some themes or pagebuilder modules may not show the images on the sitemap. You may need to add them via a filter: wpseo_sitemap_urlimages.
    This filter will then register images to appear on the sitemap. If you are not sure how to use the filter you may wish to speak with your theme or plugin developer.

    Wie muss ich vorgehen um den Filter anzuwenden bzw. um die Images in der Sitemap anzuzeigen?

    Mit besten Grüßen,
    Michael

    #888767

    Hey fragezeichen,

    All images uploaded to WordPress should appear in your sitemap, could you give us an example of an image which is not in the sitemap and where it is located please?

    Best regards,
    Rikard

    #888810

    Hello,

    all Images are inside the attachement sitemap, but in the pages or portfolio sitemaps are only a view impages listed.

    For example our homepage is show in the sitemap without any image.

    All links are in the private Content.

    Regards, Michael

    #888817

    Hello,

    I hope my previous email was not to confusing, here is another example

    Regards, Michael

    #889122

    Hi,

    Please refer to this post – https://kriesi.at/support/topic/sitemap-image-urls-for-cdn/#post-885203

    Best regards,
    Yigit

    #889929

    Hi,
    all I have to do is to put the code inside function.php, right?
    At the beginning or at the end of the function?

    In the posting a “script management plugin” was mentioned.
    Do you know which plugin or what does it mean?

    Do I have to create a child theme to do this changes?

    Regards, Michael

    #890243

    Hi Michael,

    You should use a child theme, so that the changes remain on the next update.

    Best regards,
    Victoria

    #890378

    Hello,
    I am no sure if the code will fix my problem since it has to do with CDN.
    For example the code contains “$src = str_replace( ‘https://www.domain.com’, ‘https://cdn.domain.com’, $src );”

    But I am not dealing with CDN.

    I need a solution to show all images in my xml-Sitemap.
    So fare, the images are only in the attachement-Siteamp but not in all other Sitmaps.

    Are you sure the code in the refered posting will solve my problem?

    Kind regards, Michael

    #890405

    Hello,
    I belive following thread contains the answer to my problem?
    https://kriesi.at/support/topic/how-to-make-images-in-masonry-gallery-to-be-indexed-in-seo-yoast-sitemap/#post-832895

    But I dont have a problem with masonry-Gallery – all I want is that “normal” images are inlcuded in the XML-Sitemap generated by Yoast SEO Plugin.

    As mentioned before, following Portfolio webpage has many Images:

    But in Portfolio-Sitemap it has zero Images:
    https://www.topjobbewerbung.com/portfolio-sitemap.xml

    Will the filter solve this problem?
    Kind regards, Michael

    #891537

    Hello,
    can someone please answer from the support team?

    Kind regards, Michael

    #891820

    Hi,

    I believe the solution is to remove the:

    
    $src = str_replace( 'https://www.domain.com', 'https://cdn.domain.com', $src );

    like this:

    add_action('after_setup_theme', 'ava_disable_wpseo_sitemap_filter');
    function ava_disable_wpseo_sitemap_filter() {
         remove_filter('wpseo_sitemap_urlimages', 'avia_filter_wpseo_sitemap_urlimages', 10, 2);
    }
    add_filter('wpseo_sitemap_urlimages', 'avia_filter_wpseo_sitemap_urlimages_new_name', 10, 2);
    function avia_filter_wpseo_sitemap_urlimages_new_name($images, $post_id)
    	{
    	  $post = get_post($post_id);
    	  if (is_object($post)) {
    			$content = $post->post_content;
    			$elements = apply_filters('avf_add_elements_wpseo_sitemap',
    			 array(
    				'masonry' => array(
    					'pattern' => '/\[av_masonry_gallery [^]]*]/',
    					'source' => 'ids'
    				),
    				'gallery' => array(
    					'pattern' => '/\[av_gallery [^]]*]/',
    					'source' => 'ids'
    				),
    				'horizontal' => array(
    					'pattern' => '/\[av_horizontal_gallery [^]]*]/',
    					'source' => 'ids'
    				),
    				 
    				'accordion' => array(
    					'pattern' => '/\[av_slideshow_accordion(.+?)?\](?:(.+?)?\[\/av_slideshow_accordion\])?/sim',
    					'source' => 'sid'
    				),
    				'slideshow' => array(
    					'pattern' => '/\[av_slideshow(.+?)?\](?:(.+?)?\[\/av_slideshow\])?/sim',
    					'source' => 'sid'
    				),
    				'slideshow_full' => array(
    					'pattern' => '/\[av_slideshow_full(.+?)?\](?:(.+?)?\[\/av_slideshow_full\])?/sim',
    					'source' => 'sid'
    				),
    				'slideshow_fullscreen' => array(
    					'pattern' => '/\[av_fullscreen(.+?)?\](?:(.+?)?\[\/av_fullscreen\])?/sim',
    					'source' => 'sid'
    				)
    				
    			), $elements, $post_id);
    
    			$ids = avia_extract_shortcodes_attachment_ids($elements, $content);
    
    			foreach ($ids as $id)
    			{
    				$title = get_the_title($id);
    				$alt   = get_post_meta($id, '_wp_attachment_image_alt', true);
    				$src   = wp_get_attachment_url($id);
    				$images[] = array('src' => $src, 'title' => $title, 'alt' => $alt);
    			}
    	  }
    
    	  return $images;
    	}

    Please try this corrected code, if it doesn’t work please include a admin login & FTP login in the private content area so we can take a closer look.

    Best regards,
    Mike

    • This reply was modified 6 years, 11 months ago by Mike.
    #892145

    Hello Mike,
    thank you for your quick answer!

    I am sorry that I am asking stupid questions, but I am not a coder and getting confused about code changes.
    You worte I have to remove this by that, but where and how?
    Do I need to create a child theme?

    Can you please tell me what I have to do step-by-step to implement your solution?
    I realy dont want to bother you, but I am a bit afraid to mess up the whole template.

    Kind regards, Michael

    #892245

    Hi Michael,

    This code should be added to the child theme functions.php. Yes, you should use the child theme.

    Always have a backup. If something breaks you can use a backup. Or you can go to the file via FTP and remove the whole code you added.

    Best regards,
    Victoria

    #892445

    Hello,
    on the 28. Dec. I have created a child theme and inserted the function you have mentioned before.
    The Child Theme is activated.
    I belive the solution is still not working properly, because some pages are listed with zero images on the sitemap, altough they have images.
    Please advice what to do to get all images listed in the yoast-xml-sitemaps.

    Best regards, Michael

    #893001

    Hi,

    The Method that Mike proposed, is a way to add the images.
    If you are using other shortcodes to add images, like avia images for example, you have to add those shortcodes also into the array.

    Best regards,
    Basilis

    #893185

    Hello,
    I have no idea what you mean with “avia images”?
    I only use the enfold theme as it is provided. How can I check if I use Avia Images as you mentioned?

    Kind regards,
    Michael

    #894573

    Hi,

    The filter above is included in the theme by default so you don’t have to add it. Please make sure that the site is running on the latest version of the theme, 4.2.1. And then add this filter in the functions.php file.

    add_filter('avf_add_elements_wpseo_sitemap', function($elements, $postid) {
    	$image = array(
    		'image' => array(
    			'pattern' => '/\[av_image [^]]*]/',
    			'source' => 'src')
    	);
    
    	return array_merge($image, $elements);
    }, 10, 2);

    Or post the login details in the private field so that we can implement it.

    Best regards,
    Ismael

    #907947

    Hello,
    sorry for my late reply.
    Do you mean I dont need the child theme? All I have to do is to implement your filter into functions.php?

    Regards, Michael

    #907966

    Hi,
    You should have a child theme and you can include the filter in the child theme functions.php
    This way you will not lose this function with future updates.

    Best regards,
    Mike

    #907981

    Hi,
    Ismael mentioned that the filter you gave me in an early message in this threat “is included in the theme by default”.

    That means I can remove the long filter from the child theme and insert instead the other filter into functions.php on the child?

    Ragards, Michael

    #908153

    Hi,
    That is how I read the message also, please try and let us know.

    Best regards,
    Mike

Viewing 21 posts - 1 through 21 (of 21 total)
  • You must be logged in to reply to this topic.