-
AuthorPosts
-
December 13, 2017 at 4:13 pm #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,
MichaelDecember 14, 2017 at 7:24 am #888767Hey 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,
RikardDecember 14, 2017 at 10:49 am #888810Hello,
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
December 14, 2017 at 10:57 am #888817Hello,
I hope my previous email was not to confusing, here is another example
Regards, Michael
December 14, 2017 at 10:11 pm #889122Hi,
Please refer to this post – https://kriesi.at/support/topic/sitemap-image-urls-for-cdn/#post-885203
Best regards,
YigitDecember 18, 2017 at 9:08 am #889929Hi,
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
December 18, 2017 at 9:09 pm #890243Hi Michael,
You should use a child theme, so that the changes remain on the next update.
Best regards,
VictoriaDecember 19, 2017 at 9:41 am #890378Hello,
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
December 19, 2017 at 11:13 am #890405Hello,
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-832895But 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.xmlWill the filter solve this problem?
Kind regards, MichaelDecember 22, 2017 at 11:41 am #891537Hello,
can someone please answer from the support team?Kind regards, Michael
December 23, 2017 at 4:52 pm #891820Hi,
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 7 years ago by Mike.
December 27, 2017 at 11:41 am #892145Hello 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
December 27, 2017 at 9:54 pm #892245Hi 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,
VictoriaJanuary 2, 2018 at 11:07 am #892445Hello,
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
January 4, 2018 at 12:38 am #893001Hi,
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,
BasilisJanuary 4, 2018 at 10:52 am #893185Hello,
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,
MichaelJanuary 8, 2018 at 4:50 am #894573Hi,
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,
IsmaelFebruary 5, 2018 at 1:51 pm #907947Hello,
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
February 5, 2018 at 2:11 pm #907966Hi,
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,
MikeFebruary 5, 2018 at 2:18 pm #907981Hi,
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
February 5, 2018 at 7:23 pm #908153 -
AuthorPosts
- You must be logged in to reply to this topic.