• Resolved tristup

    (@tristup)


    Hi Team,

    I am trying to update the max_entries value using the wpseo_sitemap_entries_per_page filter is not working. I have added a custom function which returns the max_entries value but it is not modifying the value. Added the code in functions.php. Please help on this.

    add_filter('wpseo_sitemap_entries_per_page', 'change_max_entries');
    function change_max_entries(){
    return 100;
    }

    Thanks in advacne.

    • This topic was modified 3 months, 2 weeks ago by tristup.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Maybellyne

    (@maybellyne)

    Hello @tristup

    Thanks for reaching out about your sitemap. There are two options to alter the number of sitemap entries:

    1. This filter
    2. Install and activate the Yoast Test Helper plugin. Navigate to WordPress > Tools > Yoast Test > XML Sitemaps to set your desired limit.
    Thread Starter tristup

    (@tristup)

    Hi @maybellyne,

    I have already tried the wpseo_sitemap_entries_per_page filter, which didn’t work. And I didn’t find the second option you mentioned.

    Can you please be specific about the filter you are referring to. Also please add some screenshot for 2nd option to understand it.

    Thanks again, will wait for your quick response.

    Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @tristup

    For the first option: Can you kindly share with us your site URL?

    For the second option: please know that you will have to install and activate the?Yoast Test Helper?plugin. Then navigate to?WordPress > Tools > Yoast Test > XML Sitemaps?to set your desired limit. Please check the screenshot.

    Thread Starter tristup

    (@tristup)

    Hi @611shabnam ,

    Sorry, I can’t share the URL right now, but the code shown in the URL you shared is not working after adding the same code to functions.php.

    Thread Starter tristup

    (@tristup)

    Hi @611shabnam ,

    I added the priority to the filter and it started working, but unfortunately, it works only with the small values like 100. When increased to 5000, which is higher than default 1000 it is not working. Can you please help on this. Also is there any option to increase the value only for Author / User sitemap only ?

    function max_entries_per_sitemap() {
    return 100;
    }
    add_filter( 'wpseo_sitemap_entries_per_page', 'max_entries_per_sitemap', 10, 0 );

    • This reply was modified 3 months, 2 weeks ago by tristup.
    Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @tristup

    Are you trying to increase the sitemap entry limit to 5000 for the author sitemap only?

    Thread Starter tristup

    (@tristup)

    Hi @611shabnam ,

    Yes, that is what I am trying.

    Plugin Support Mushrit Shabnam

    (@611shabnam)

    Hi @tristup

    By default, each sitemap can contain a limit of 1,000 items. If there are more than 1,000 items for a given content type, then (up to 50,000) additional sitemaps are generated to contain the overflow.

    You can learn more on sitemaps from our Yoast developer portal.

    Plugin Support Mushrit Shabnam

    (@611shabnam)

    This thread was marked resolved due to a lack of activity by the original poster. The original poster can change the status to Not Resolved to re-open the issue or open a new topic.

    If you are not the original poster but have a similar issue, please open a new topic.

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