Hi! I have been using the Slim SEO plugin for my website, and it has been an invaluable tool in optimizing our site’s SEO. I appreciate the great work you’ve done with this plugin!
I am currently working on a project where I need to include some custom URLs in the Slim SEO sitemap. These custom URLs are dynamic content loaded from an external API service. While Slim SEO is already successfully generating the primary pages on my website, I need to map these dynamic URLs to the sitemap as well.
For example, I have a landing page at mywebsite.com/cientista, which serves as a hub for various scientists. The actual content for each scientist is dynamically loaded from the API and is available at URLs like mywebsite.com/cientista/?item_id=xxx. I have the ability to generate these custom URLs programmatically from the API, but I’m struggling to get them to appear in the Slim SEO sitemap.
I’ve attempted to use the slim_seo_sitemap_post hook to add these custom URLs to the sitemap, but I haven’t been successful. Here’s a simplified version of my code:
add_filter('slim_seo_sitemap_post', 'output_test');
function output_test() {
echo "\t<url>\n";
echo "\t\t<loc>mywebsite.com/cientista/?item_id=1</loc>\n";
echo "\t</url>\n";
}Similarly, I’ve tried to use this code in my custom plugin with no actual results:
add_action('slim_seo_sitemap_post', [$this, 'output_test']);I’m reaching out to you for guidance on how I can effectively add these custom URLs to the Slim SEO sitemap. Your expertise and assistance in this matter would be greatly appreciated.
If you have any suggestions, examples, or guidance on how to achieve this, I would be grateful for your assistance. Thank you in advance for your time and support.
