Support » Plugin: Yoast SEO » Fix the path of the images in the Sitemap

  • Resolved lestadt

    (@lestadt)


    Hello, I will try to be brief and go straight to the subject. I had to disable the images in the sitemap because they did not show the correct path. The images of my publications are generated by a plugin and do not have the default path used by wordpress. Each publication has a custom field that shows the exact and correct route of the image used. The way to fix the problem would be that the generator of the sitemap will take the image of this custom field (that’s just my opinion). I know there is a filter that is to correct this issue (wpseo_xml_sitemap_img_src) however i did not know how to configure it, look for examples but i did not find anything. Can someone tell me how i can use this filter to specify the specific path of the image of each publication? Could someone show me an example? How can tell the sitemap generator the custom field so that it takes the right image? Thanks in advance, any suggestion is welcome.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    If your site has a custom solution for the image path and not the WordPress default image path, you’ll need to use the wpseo_xml_sitemap_img_src filter to modify the image path in the XML sitemap.

    We can’t offer support on custom code (needed to change (core) features of our plugin). Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes. Maybe someone watching these forums can assist you further, but if your topic is inactive for 7 days, we’ll mark it as resolved to keep the overview.

    Thank you for your understanding.

    Hello, thanks for answering, i know that the solution to my problem is in the use of this filter (wpseo_xml_sitemap_img_src) as i indicated in my original question, the problem is that all the web only appears a single example of the use of this filter and it is to change the path of the images when a CDN is used. I would not have to give a personalized code, with some examples would be enough to reach the solution by myself, it has been somewhat difficult, it is like being blind, if you ask my question here is because i did not find the solution elsewhere, maybe another more experienced user that I can show me an example of said filter in action.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    There is a example in our API page which shows how to implement the wpseo_xml_sitemap_img_src filter.

    They have closed this ticket and have marked it as resolved, but it is clear, to anyone who looks at this, that the matter is not resolved. Coincidentally they have cited the example that I quote in my original query and that does not fit my problem. In the forums of independent help they do not allow to formulate consultations on on plugin of third, is something complicated, nevertheless I keep breaking my site at every moment trying to solve this subject.

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