• Resolved jbd7

    (@jbd7)


    Hi Yoast team,

    I am using Yoast on a site using translations by Transposh, one of the main translation plugins for WordPress.

    So as to have translated pages (of the format mydomaincom/ja/2023/01/….) listed in Yoast sitemaps, Transposh integrates with Yoast, and Yoast plugin files needs to be edited.

    The edit, as described on https://vidyut.net/transposh-translation-filter-yoast-sitemaps-compatibility/, work fine with Yoast 20.2.1 : some code needs to be inserted into public function get_sitemap_links( $type, $max_entries, $current_page ) at line 242 in the file ?wordpress-seo/inc/sitemaps/class-post-type-sitemap-provider.php?

    What I wondered is, so that I can enable auto-updates for Yoast without losing my modifications, whether it’s possible to write a filter or something in my theme functions.php, that will have the same impact, and not be overwritten when I update Yoast.

    Thanks for any tip

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @jbd7

    Thanks for using the Yoast SEO plugin.

    A plugin update will likely replace your plugin files, so you’d need to re-add custom modifications made to such files. But since you’re referring to the theme’s function.php file, you may reach out to your theme developer for a filter to prevent modifications to the file from being lost after a theme update.

    Thread Starter jbd7

    (@jbd7)

    Hi Maybellyne, thanks for your reply. However it seems we didn’t understand each other.

    I’m not updating a theme. Updating Yoast will indeed replace custom modification that I have made to the Yoast plugin files.

    I found some documentation on https://developer.yoast.com/features/xml-sitemaps/api/ but nothing about the get_sitemap_links() function, and it seems there’s filter for wpseo_sitemap_entry inside it, but I also can’t find examples on how to use it.

    The wpseo_xml_sitemap_post_url hook wouldn’t work because it only alters 1 URL, while I need to add the translated URLs alongsisde the URL being processed by Yoast, and passing an array instead of a string is likely to break things.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @jbd7 I understand you have made customizations to the Yoast SEO plugin files to make Transposh work with our plugin. I cannot guarantee you won’t lose your modifications when there’s a plugin update.

    Regarding the original issue about having Transposh translated pages in a certain format included in the Yoast-generated XML sitemap, you may create an issue on GitHub.

    @smartbizzy Please open a new request. That way, it’s easier to track issues and provide assistance. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Yoast+Transposh: a hook for get_sitemap_links ?’ is closed to new replies.