• Hello everyone,
    I noticed on a customer site that every single page can also be accessed via the url /page/xx. xx is a placeholder for all possible numbers. In this particular case, the same page is called up at https://hycleaner.de and e.g https://hycleaner.de/page/11. As I have noticed this with all other WordPress websites, even those in the WP Showcase, I wanted to ask how I can avoid this? There may also be a simple solution to set the pagination to noindex. Currently all the URLs are thrown as errors in the 404 protocol and GSC.

    I apologize if this question has already been asked/answered. I wasn’t sure what keywords to look for here. Feel free to link the thread.

    Thank you very much
    Bernd

    • This topic was modified 9 months, 3 weeks ago by rocketboy85.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The page endpoint is created by WordPress via a rewrite rule and designed to allow visitors to paginate through content lists.

    You can see this rewrite rule by looking in wp_options and searching for the rewrite_rules key, which will contain an array of rewrite rules. The one you’re looking for is this:

    'page/?([0-9]{1,})/?$' => 'index.php?&paged=$matches[1]',

    You can see this in action on one of the showcase websites:

    https://www.rollingstone.com/page/2/

    At the bottom of the page, clicking on “Previous” will lead you back to the homepage, and clicking on “Read More” will lead you to the third page.

    That said, depending on how the website was developed, configured, and existing templates, you may not see the behavior which it was designed for.

    If you don’t need this, you could simply remove the rewrite rule dynamically using the rewrite_rules_array filter, or you could delete it permanently from the option in the database. Note that there may be additional rewrite rules, such as the archive, which you may not need as well.

    For example:

    https://www.rollingstone.com/2013/page/2/

    This shows page 2 of all posts created in 2023. That’s a different rewrite rule you’ll find in the rewrite rule array within the database.

    Thread Starter rocketboy85

    (@rocketboy85)

    Hello Ryan,
    thank you very much for your detailed explanation! I will test it and report back here if it worked.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 / Page Pagination’ is closed to new replies.