Submit dynamic pages to the sitemap

#364193
  • Resolved comofazerumpoema
    Rank Math free

    Hello, how are you?

    My question is: my site has a page that has a search box that generates dynamic pages through two parameters selected by the user.

    After the search, the generated URLs come out as “/?term=example&type=example”.

    I would like to know if there is any way to have all possible result pages submitted to Google via sitemap, and how I can do this.

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Any help?

    Hello,

    Thank you for contacting Rank Math today and we apologize for the unexpected delay.

    You can use the following filter to add additional URLs to a specific type of sitemap: https://rankmath.com/kb/filters-hooks-api-developer/#add-extra-urls-in-sitemap

    You can create a loop to fetch all the dynamic URLs and then append the query parameter to all of them.

    Hope this helps solve your issues.

    Don’t hesitate to get in touch if you have any other questions.

    Hello! Thank you for the reply.

    I didn’t understand exactly how I can use this filter, creating this loop.

    In the way I understood, I would have to manually add all the URLs I want to be indexed.

    Can you explain to me how do I add this automatic loop using only the master page as a basis?

    Thank you!

    Hello, Zennifer.

    Is that link right?

    Hello,

    Please ignore the previous reply of Zennifer. You will have to manually add each URL using the filter. Here is an example:

    add_action( 'rank_math/sitemap/page_content', function() {
    	return '<url>
    			<loc>https://rankmath.com/some-custom-url-1/</loc>
    			<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    			</url>
    			<url>
    			<loc>https://rankmath.com/some-custom-url-2/</loc>
    			<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    			</url>
    			<url>
    			<loc>https://rankmath.com/some-custom-url-3/</loc>
    			<lastmod>2020-06-10T20:20:20+00:00</lastmod>
    			</url>;
    });

    This will add the URLs to your page sitemap.

    Hope this helps. Let us know if you need any other assistance.

    Thanks.

    Hello, Jaideep.

    So there is no way to make the “loop” mentioned by Jeremy to fetch the URLs?

    Manually adding the URLs is impractical for me, as there are more than 90,000 possible results in my search box, that searches in a custom database.

    As I mentioned, my search box has only two parameters that are set by the user and the result URLs come out as “/?term=example&type=example”.

    What I would like to know is if there is a way for Rank Math to consider all these results as blog posts without me having to manually add them, because this can even be done directly from Search Console.

    Is there any solution?

    Thanks for the attention.

    Hello,

    You will have to hire a developer to modify the filter for you and create a loop to add all the URLs in the sitemap.

    However, it is not recommended to add so many URLs in your sitemap and it is also not recommended to get the filter-generated URLs indexed as it is just going to exhaust your crawl budget and can create problems with the ranking of your actual product URLs.

    If you still want to add the URLs to the sitemap then please hire a developer as further customization of the filter falls out of the scope of our support.

    Let us know if you need any other assistance.

    Thanks.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Submit dynamic pages to the sitemap’ is closed to new replies.