Add additional pages to wordpress yoast seo sitemap xml programatically

0 votes
. I have a Wordpress site where the Yoast Seo plugin has been installed, titles, descriptions have been added, I could also manage to change the title tag, canonical url generated by it with the wpseo- filters.

The sitemap xmls are also generated fine, but I would need to add additional pages to it. We have a search page on the site, we search by a rental custom post type. Rentals can be searched by location. The search page is eg.: /rentals.

I have done a redirection for the urls: /rentals/budapest /rentals/hungary ... there are more locations. so they go to the rentals page, where I set the search parameters, I have changed the canonical urls of these pages, but I would like to add these pages to the xml sitemap also. The problem is that these page do not exist in the database.

Is there a filter that I coul use to add these pages to the sitemap.xml in Yoast Seo plugin?
Feb 24, 2022 in Others by Kichu
• 19,050 points
2,527 views

1 answer to this question.

0 votes
use the wpseo_do_sitemap_ filter a custom sitemap is created if you use this to add
custom sitemap xml to sitemap index page we need to use 'wpseo_sitemap_index' filter
if you have any confusion use this link https://gist.github.com/mohandere/4286103ce313d0cd6549
answered Feb 25, 2022 by narikkadan
• 63,420 points

Related Questions In Others

0 votes
1 answer

Yoast Seo breadcrumbs: How to add custom text to category and tag name

use this code  add_filter('wpseo_breadcrumb_single_link', 'filter_breadcrumbs_for_h1', 10, 2); function filter_breadcrumbs_for_h1($link_output, ...READ MORE

answered Feb 12, 2022 in Others by narikkadan
• 63,420 points
427 views
0 votes
1 answer

How to add a class to the <a> tag in Yoast SEO breadcrumbs?

add_filter( 'wpseo_breadcrumb_single_link', 'ss_breadcrumb_single_link', 10, 2 ); function ss_breadcrumb_single_link( ...READ MORE

answered Feb 22, 2022 in Others by narikkadan
• 63,420 points
1,345 views
0 votes
1 answer

Yoast Seo breadcrumbs: How to add custom text to category and tag name

add_filter('wpseo_breadcrumb_single_link', 'filter_breadcrumbs_for_h1', 10, 2); function filter_breadcrumbs_for_h1($link_output, $link) {     if ...READ MORE

answered Feb 25, 2022 in Others by narikkadan
• 63,420 points
1,177 views
0 votes
1 answer

how to show the <meta> values of yoast seo with some function?

check this folder : wordpress-seo\src\presenters\open-graph you can ...READ MORE

answered Feb 10, 2022 in Others by narikkadan
• 63,420 points
408 views
0 votes
1 answer

How to Access Yoast SEO tags in Wordpress API Callback

use rest api to request for the ...READ MORE

answered Feb 12, 2022 in Others by narikkadan
• 63,420 points
1,573 views
0 votes
1 answer

Yoast SEO (WordPress Plugin) - Get plugin generated data manually

get_post_meta(), use this to get the meta ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,420 points
1,265 views
0 votes
1 answer

Simple question regarding PHP, Wordpress & Yoast SEO

the way the search engine displays your ...READ MORE

answered Feb 14, 2022 in Others by narikkadan
• 63,420 points
326 views
0 votes
1 answer

how can I change yoast seo generated sitemap file URL?

plugins/wordpress-seo/inc/sitemaps/class-sitemaps-router.php go to this directory and change the ...READ MORE

answered Feb 22, 2022 in Others by narikkadan
• 63,420 points
3,050 views
0 votes
1 answer

How to add meta keyword in wordpress using yoast seo plugin.?

if you dont want to use code ...READ MORE

answered Feb 12, 2022 in Others by narikkadan
• 63,420 points
762 views
0 votes
1 answer

How to add SEO properties in sitemap using xml

i think your layout of the sitemap ...READ MORE

answered Feb 12, 2022 in Others by narikkadan
• 63,420 points
645 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP