What I wanted to say in my previous comment:
This hook is only fired when the sitemap is being built. After that, it’s cached and always served from cache. That means you’ll never see any change on the frontend because it’s all cached.
To disable the cache you can use the following code during development:
add_filter( 'wpseo_enable_xml_sitemap_transient_caching', '__return_false' );
After that, the sitemap is never served from cache but always built when viewing the sitemap in the frontend. Then you’ll see some changes.
Related Posts:
- Why do I get a 404 for my sitemap index after installing Yoast? [closed]
- Yoast SEO creates sitemaps with a dash ‘-‘ but I can’t get Bing to accept them [closed]
- WordPress site running on Yoast not being indexed into Google News [closed]
- Changing Post Sitemap Frequency to Hourly [closed]
- how to add urls dynamically into the sitemap
- Display Yoast WordPress SEO title in archive template
- How to add a page to the Yoast breadcrumbs
- How to print meta description to posts? [closed]
- Removing “Noindex, follow” from pages [closed]
- Change content language for one page
- Add Page number to Meta Description in WordPress SEO by Yoast [closed]
- Manipulating wp_head content
- Exclude custom post_type in sitemap generation?
- Yoast’s WordPress SEO plugin is not showing the correct snippet [closed]
- How do I get WordPress URL rewrites into Sitemap?
- Yoast Sitemap grouping external sitemaps [closed]
- XML Sitemap : broken XML file [closed]
- make the url unlimited
- Query Post Based of Yoast Primary Category Class
- Wrong Canonical url link
- How to parse Yoast SEO Snippet Variables
- Post content blank after disabling Yoast SEO
- With the Yoast SEO plugin, is it possible to make the meta description a required form field?
- WP-RestAPI and xml sitemap
- help to write a custom php script to settingup yoast priority to pages or posts
- robots.txt Not Updating
- Yoast Seo Plugin – Set no-index to a post automatically when a post is set to sticky [closed]
- Yoast SEO Plugin: Double Title isse [closed]
- Edit title-tag in wp_head with yoast seo
- Way to change the Yoast Schema depending on post type? [closed]
- Change base URL of Yoast Sitemap [closed]
- Variable focus word YOAST
- How can I add a second Open Graph image to a site using Yoast? [closed]
- WordPress Sitemap including pages that aren’t there
- How to call Yoast Seo Tags without needing to call the whole wp_head?
- My WordPress website has 2 header [closed]
- Add content before Yoast description
- Twenty Eleven Theme – SEO Yoast duplicate site titles
- Add Page number to Meta Description in WordPress SEO by Yoast [closed]
- Blog home page has canonical link that is incorrect. Do not see where to change this
- How to Modify Breadcrumb Page Names for Specific Pages? [closed]
- P3 Profiler and Yoast SEO plugin
- How to use the Yoast SEO wpseo_canonical filter to set a canonical URL for /, /au/ & /uk/ sites in a MU environment
- Yoast Metadata API to adjust/override the meta description
- Prevent Yoast from removing the canonical tag if robots meta tag is set to noindex [closed]
- Embed sitemap in a page
- Fixing link rel=”next” in Yoast SEO for paginated links
- how to disable Yoast SEO schema from homepage only?
- WPML and Yoast SEO setup on a wordpress site is not working properly
- Remove canonical link element from noindex pages
- What could be causing the category to be appearing as the post title in the title tag?
- Turn off auto 301 on archive pages? [closed]
- Yoast: do I still need to manually insert meta tags in my theme or will Yoast do this for me? [closed]
- Hard-code SEO Title defaults across all sites on a multisite
- WordPress site using Yoast SEO being blocked from indexing by robots.txt
- SEO Yoast Menu Not working
- Wrong Open Graph image is shown (og:image) using yoast
- An inactive plugin causes an HTTP 404 issue on a translated post – WPML
- Set default image for twitter cards with Yoast?
- Using $this with an anonymous function in filters
- Exclude WooCommerce terminations from YOAST
- Overwriting yoast’s og:meta output?
- Plugin scans for images in post_content, how about “featured image”?
- yoast seo plugin – remove bulk title and description editor menu from non-admins [closed]
- Yoast SEO makes repeated INSERT queries loading any page
- yoast sitemap xml
- Remove a specific sitemap from Sitemap_index.xml
- Yoasts plugin sitemap not detecting correct category URL format
- Remove the Yoast SEO Post Metabox [closed]
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- How can I modify the Capability needed to access a plugin’s options?
- Custom Yoast Breadcrumbs URL
- root-relative links for multiple parked domains
- Uploading sitemap.xml
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- Yoast SEO blocking/re-initialising longer running process
- Paginated HTML Sitemap
- Create a sitemap without a plugin – get parent pages only?
- Add meta value to custom post type on publish
- How to solve Robots.txt problem with WordPress fresh install?
- Error “preg_match_all” with WordPress SEO by Yoast plugin [closed]
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- w3 total cache and sitemap.xml
- the_content filter together with require_once returns 1 instead of the content of the included file
- Yoast SEO breaking media upload
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Help in using SEO Plugins: SEO Ultimate And Yoast SEO Plugin
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- How-to: This block can only be used once
- How do I change the element using a custom function?
- Genesis / custom template page / setting the page title and meta desc
- Post Thumbnail missing when using webp format while sharing
- Does anyone know why my SEO and title become one?
- SEO Site Title appearing in google search despite not being added
- Reorder title tag and description tag with wpseo_title and wpseo_metadesc
- load_textdomain won’t load my .mo file
- seo meta description issue in google search
- How Create LastMod and Update Date Only on Taxonomy Category and Tags
- Hacked/cloaked sitemap [closed]