Tagged: , ,

Viewing 30 posts - 1 through 30 (of 54 total)
  • Author
  • #587771

    How do you make images in masonry gallery be indexed in seo yoast sitemap? I have over 60 images in my masonry gallery, but seo yoast is only saying theres 1 image on that page, which i’m assuming is the featured image.

    How do i fix this?


    Hey deanwilson012,

    I think what you are referring to is background images and I don’t think the Yoast plugin will include those, but I wouldn’t worry too much about it since search engines will see the image even if Yoast doesn’t.



    Okay. The main reason for my concern is that google webmaster says I have only a small number of images submitted Much smaller than what I have on the site.

    Based on what you’re saying I shouldn’t worry because that’s based on my sitemap and Google will find those images when they do their own crawl?



    Best regards,



    Google will NOT automatically find your images and add them to its index.
    I have been trying for over two years to get Kreisi to add functionality for images to be crawled by YOAST SEO and still nothing gets done.

    I can prove that by NOT having an accurate sitemap with an accurate number of actual images DOES harm the amount of images crawled and indexed.
    Why on earth won’t Kreisi do something about this?
    It’s fundamental to users of the theme. I have to run a modified version of Udinra’s Image Sitemap to catalogue all my images. Now, I have 4600 of them on my site and have 4000 indexed. Pretty good.
    Before when I used Yoast i could only ever get around 450 indexed no matter what I tried – and I’ve been doing this a long time now.

    Honestly guys, 116,000 sales and how many users will have Yoast SEO? This is basic and needs doing but no-one will listen to the dozens of threads talking about this.

    Such a shame guys, especially when I can prove that images will NOT get indexed without an accurate sitemap.

    • This reply was modified 7 years, 4 months ago by Swarez.

    Hi Ed,

    Thanks for your feedback. I’m no expert when it come to what search engines crawl or how they do it, but how does search engines not crawling your content relate to our theme?

    Best regards,


    Hi Rikard

    how does search engines not crawling your content relate to our theme?

    You are selling an SEO-friendly theme that won’t let Yoast SEO crawl the vast majority of images and collect that data into a sitemap (only inline images in text and featured images). If a sitemap cannot be produced properly then Google will struggle to index images and I can prove that.

    So ultimately your SEO-friendly theme isn’t so friendly because although Google can see image URL’s it probably won’t index them correctly. Again, I can prove that over the last two years of trials.

    I’d have thought that if you’re selling a theme that won’t allow a sitemap to be correctly produced, by the biggest plugin on WordPress, that you’d kinda want to fix that?

    It’s a shame the ALB won’t let Yoast SEO crawl images – despite the fact that Yoast make the data and hooks available to developers – I’m sure your customers (and developers) that buy your theme would benefit from you telling them all their content will get put into Yoast’s sitemap and therefore stand a much better chance at being indexed.

    We all need our images and content indexed on search engines don’t we? That’s how the internet works right? But your theme blocks Yoast from collecting accurate data to be able to tell Google what’s in a page. Just because code can be parsed, rendered and crawled does not guarantee it will be indexed; that’s why we have sitemaps.

    Google’s own best practices suggest using a sitemap to tell the spiders about the content and structure of a website. Now why would they recommend that do you think?

    Can you see my point Rikard? Seriously, for the love of God, please get Kreisi to consider this – it could make a huge difference to everyone, not just those of us who work in a visual medium.

    Kind regards


    I have been using enfold for years and 100% agree with Ed.

    It actually makes me regret using this theme and will likely find an alternative when i revamp the website.

    I love everything else about it, but then I remember my images arn’t being indexed which is affecting my seo rankings which is affecting my businesses’ revenue…


    Yes!!! Enfold and Yoast SEO do not play as nicely together as they should, while tons of other themes do. The struggle is real, : )

    Playing nicely with Yoast SEO has been an Enfold feature request for quite some time. I’m a huge fan of Enfold, but I have little confidence that the feature requests are even considered. Enfold has an “Enfold Feature Requests” sticky post that is locked and has not been updated in YEARS.




    We have reported that to Kriesi and we will see if he can check with the Yoast Team ( or hey, anyone of you could speak with them to be able to make their plugin work with Enfold, one of the Top themes that power 100K sites, I am sure they will hear you better ).

    In any case, we have reported it and Kriesi will check what he can do.
    Thank you very much

    Best regards,


    Hi Basilis

    Thank you for taking this to Kreisi

    I have already talked to Yoast and they have said that it’s you who needs to make it work with Yoast SEO – they won’t do it their end despite me asking them to support over 100,000 users.

    Over to you guys please. We need this.



    I have talked to them as well and have posted other threads on this subject on here.

    If Kreisi isn’t aware of the long term outcry around this then he clearly isn’t paying attention.


    Didn’t we used to have a voting system like https://www.uservoice.com, for feature requests? If we could have that system, perhaps Kriesi could pick say, the top 2 or 3 (depending on complexity) and roll them into the builds as possible. Right now, we have no clue if feature requests are being heard, or even what those requests are.


    Well, I have the same problem with the mason gallery. But I found out that if I use the regular ‘image’ input option or the ‘image slider’, the seo is seen by google, so despite the fact the mason gallery is way nicer to look at and easier to use, I don’t use it anymore. But of course that’s not the way it should be!
    And eeeehmm, I don’t care if YOAST sees my things, it’s google who needs to see it. Maybe Yoast is sort of a fortune teller, telling us, google is not going to see it. But Yoast says the same about some text in the theme, that it’s not there. But I have the feeling Google does see it. So I don’t trust Yoast all the time either.

    But this discussion is indeed going on for quite some years now and it surprises me that it’s still not solved, cause in general the helpdesk is really quick and helpful with most things, a positive thing in theme land. But like people say here, the mason problem has got to be solved… Otherwise you’re gonna lose clients…



    Thank you for giving and providing all that great feedback.
    Kriesi does take in consideration as much of those things as possible and you can notice that there are multiple updates that
    are been taken in consideration for the end results.

    Here you can add what you believe is important and also spend some time to see the stuff around, maybe if there is something you like, go ahead and vote for it!

    Thank you very much

    Best regards,


    Dear Basilis,

    Well, your answer confirms all the discussions and complaints of my predecessors. It’s a political answer moving away from the problem, cause apparently it has been put in the feature requests before and nothing was done with it.
    I don’t want to move again to another theme, so for now, I’ll stay, but I am actually thinking about rewriting my review about Enfold, because of this. This is ridiculous, the way you guys talk about this problem and do like it’s not there. That’s the worst thing a company can do, ignore problems… Not good for business!!!

    grt Boris


    Thank you Boris for the support.

    This thread isn’t the only one I have posted about getting this fixed.

    They give the same answers every time and as you said it says a lot about their company.

    Someone should honestly make sure this issue is posted under the reviews of this theme, so people don’t invest time and money into a theme that has seo limitations. Especially because most won’t find out until they build out those masonry galleries and let them stand for months.

    As a small business owner the decision to use the enfold theme was a mistake that I regret because it will force us to fundamentally redo our website twice in a short period of time instead of just once.


    Hey Dean,

    You’re welcome, I bumped into your posts already yeah. Too bad the whole theme and service was so very good, until you bump into this stupid item :-(

    grt Boris



    The problem is that the Yoast SEO sitemap’s image parser (wp-content\plugins\wordpress-seo\inc\sitemaps\class-sitemap-image-parser.php -> parse_html_images) can only detect img tags. The plugin won’t be able to index images that are set as background which is what happens when the masonry gallery’s “Size Settings” is set to “Perfect Grid” or “Perfect Automatic Masonry” options. Have you tried setting it to “Flexible Masonry”?

    Best regards,



    UPDATE: One solution is to add the images manually for pages with the masonry gallery.

    function avia_wpseo_sitemap_urlimages($images, $post_id)
      $post = get_post($post_id);
    	if($post->ID == 11) {
    		$images[] = array('src' => 'image1.jpg', 'title' => 'image title 1', 'alt' => 'image alt 1');
    		$images[] = array('src' => 'image2.jpg', 'title' => 'image title 2', 'alt' => 'image alt 2');
    		$images[] = array('src' => 'image3.jpg', 'title' => 'image title 3', 'alt' => 'image alt 3');
    		$images[] = array('src' => 'image4.jpg', 'title' => 'image title 4', 'alt' => 'image alt 4');
      return $images;
    add_filter('wpseo_sitemap_urlimages', 'avia_wpseo_sitemap_urlimages', 10, 2);

    Adjust the “$post->ID” to the id of the page. These images are going to be included in the sitemap_index.xml file.

    Best regards,


    Thank you @Ismael
    For the sizes and frequency of my Masonry Galleries the manual option is absolutely not feasible and I shouldn’t have to do that really should I?.
    I will test the Flexible option and report back later today.

    – Yoast SEO is not the answer to everything I agree but having a well produced and accurate Sitemap is good practice. I don’t want multiple sitemaps from different plugins I just want one that is accurate and will find all my content and report it correctly.
    You are right that Google will crawl and index a site without one but for the crawl bots to accurately crawl your content and structure (and with more favorable frequency) having an accurate sitemap is important.
    If Enfold can’t be seen by the most popular Sitemap code on the planet that makes me feel disappointed. Perhaps the theme developers need to move away from coding fancy looking animations and concentrate on real-world usability? Just my thoughts.


    Hi all,

    For masonry galleries (or other shortcode galleries) there is a simple function: wp_prepare_attachment_for_js()
    Moderators can use that and create another function for us? So no need to any modify post->ID etc


    • This reply was modified 6 years, 11 months ago by KentAjans.

    @ismael – that suggestion of choosing Flexible Masonry doesn’t work – Yoast still only picks up the Featured Image son the page – here is an example: https://www.swarez.co.uk/gallery-commissioned-purchased-art/
    All images in the Masonry are set as the flexible option – no change to Yoast’s Page Sitemap (https://www.swarez.co.uk/page-sitemap.xml/)
    Can the change suggested by @KentAjans be implemented soon?
    This issue, together with the inability to add Rich Snippets, will become more of an issue as time moves on. There are a lot of things you guys need to do to make Enfold more future proof. I’m just trying to help.
    Please Ismael, can you get Kreisi to sort this out? It’s important.



    Thank you for the update. We created another filter that will automatically index or include the masonry images in the sitemap_index.xml.

    // SEE BELOW



    Finally! Congrats


    Thank you very much! I was waiting for this a long time.

    Will this function be implemented in the future updates?

    And now you did this trick, is it also possible to create a function for single images added with the Avia Layout Builder to a post, page or portfolio-item??


    There we go!!!!!
    Thank you; we got there in the end.
    Now we need the same for image galleries…

    • This reply was modified 6 years, 11 months ago by Swarez.

    Aha, so apparently there is a solution. Weird that it took so long, but better late than never, right? ;-)

    But, eeehmmm, how and where do we implement this solution @Ismael ? :-P



    Glad that it is working. We improved the function and created a filter so that you can add more shortcodes or elements that can be indexed by the plugin.

    function avia_extract_shortcode($elements, $content) {
    	$container = array();
    	if(!empty($elements)) {
    		foreach ($elements as $key => $element)
    			preg_match_all($element['pattern'], $content, $shortcodes);
    				foreach($shortcodes[0] as $shortcode)
    					switch ($element['source']) {
    					case 'ids':
    							$src = '/ids=\\\'(\d+(,\d+)*)\\\'/';
    					case 'src':
    							$src = '/attachment=\\\'(\d+)\\\'/';
    					case 'sid':
    							$src = '/id=\\\'(\d+)\\\'/sim';
    					$sid = array();
    					preg_match_all($src, $shortcode, $id);
    					if($src = 'sid') {
    						foreach($id[1] as $key => $value) {
    							$sid[] = $value;
    						$sid = implode(',', $sid);
    						$id[1] = $sid;
    					$container[] = $id[1];
    	if(!empty($container)) {
    		foreach($container as $key => $value) {
    			$container[$key] = explode(',', $value);
    	if (count($container) > 0) {
    		$container = call_user_func_array('array_merge', $container);
    	return $container;
    function avia_filter_wpseo_sitemap_urlimages($images, $post_id)
      $post = get_post($post_id);
      if (is_object($post)) {
    		$content = $post->post_content;
    		$elements = apply_filters('avf_add_elements_wpseo_sitemap',
    			'masonry' => array(
    				'pattern' => '/\[av_masonry_gallery [^]]*]/',
    				'source' => 'ids'
    			'gallery' => array(
    				'pattern' => '/\[av_gallery [^]]*]/',
    				'source' => 'ids'
    			'horizontal' => array(
    				'pattern' => '/\[av_horizontal_gallery [^]]*]/',
    				'source' => 'ids'
    		), $elements, $post_id);
    		$ids = avia_extract_shortcode($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;
    add_filter('wpseo_sitemap_urlimages', 'avia_filter_wpseo_sitemap_urlimages', 10, 2);

    If you want to add the image element, use the following filter.

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

    The masonry, gallery and horizontal gallery elements are included by default.




    : Please try it in the functions.php file.

    NOTE: Don’t forget to remove the previous filter.


Viewing 30 posts - 1 through 30 (of 54 total)
  • The topic ‘How to make images in masonry gallery to be indexed in seo yoast sitemap’ is closed to new replies.