image gallery site map

#179191
  • Resolved Aaron
    Rank Math free

    I’m using the JetEngine plugin to create a custom post type with a custom meta field of type ‘gallery’ that holds images attached to each post. These images are not currently included in the Rank Math site map.

    Under the ‘sitemap settings’ for the custom post type in Rank Math, there is an ‘image custom fields’ input. However, this input is looking for a meta field with URLs.

    In my case, each post has a meta_key called ‘project-gallery’ in the _postmeta table, and the corresponding meta_value is a list of post-IDs, NOT URLs. Is there a way to have these images included in the sitemap?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Brian
    Rank Math free

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Kindly ensure that you enter the individual custom field (post meta) names that contain image URLs to include them in the sitemaps.

    An example of this would be my_custom_image_url_field but the exact field would depend on how you have set it up.

    If still not possible, you can use the following filter to include the images from the Custom field:
    https://rankmath.com/kb/filters-hooks-api-developer/#remove-change-images

    Here is an example:
    https://github.com/rankmath/seo-by-rank-math/blob/master/includes/modules/woocommerce/class-sitemap.php#L31

    Hope that helps. We really look forward to helping you more.

    Thank you.

    Aaron
    Rank Math free

    Let me give an example that will hopefully help:

    I have a post titled ‘Taco Bell’ that has an image gallery attached to it as described previously.

    In the wp_posts table, for post_title=’Taco Bell’, the ID=9588

    In the wp_postmeta table, for post_id=9588 there are various meta key/value pairs. One of those is meta_key=’project gallery’, with meta_value=’9591,9592,9593,9594,9595′ etc. These are post IDs.

    So if, for instance, I look up ID=9591 in the wp_posts table, it has a post_type=’attachment’ and post_mime_type=’image/jpeg’. The GUID for this post has the image URL. Additional, if you lookup this post in the wp_postmeta table, you’ll find the wp_attached file (file name) and the _wp_attachment_metadata (serialized array of thumbnail info)

    Therefore, I don’t have a custom field name with an image URL. I have a custom field name with a list of Post IDs, which in turn indirectly reference Image URLs.

    Brian
    Rank Math free

    Hello,

    Thank you for getting back to us.

    Upon further clarification have come to a realization that Rank Math is not able to support some gallery plugins. Normally Rank Math uses the images added in the main content area of the post or taxonomies.

    Rank Math reads and decodes the default WP gallery shortcode but not another custom gallery within the post editor section.

    In your case here you seem to be using ACF from JetEngine and we believe that the plugin has a custom implementation of ACF that prevents Rank Math from seeing the content.

    Therefore at the moment, the plugin is able to read images from the gallery and include them in the sitemap.

    I would recommend that you contact the JetEngine plugin team and ask them to add the compatibility code to their plugin.

    Hope this clarifies your doubts. Let us know if you have any other questions.

    Aaron
    Rank Math free

    Got it, thanks Brian, I’ll contact the team from Jet Engine and see what they say.

    Brian
    Rank Math free

    Hello,

    Thanks for your follow-up.

    Sure, please let us know how that goes.

    Also, If you have another question in the future, please feel free to reach out, and it will be our pleasure to assist you again.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The ticket ‘image gallery site map’ is closed to new replies.