If anyone still has this issue (this post is quite old), I found a very helpful snippet in this blog post: https://www.grzegorowski.com/wordpress-rewrite-rules
/**
* Reprioritise pagination over displaying custom post type content
*/
add_action('init', function() {
add_rewrite_rule('(.?.+?)/page/?([0-9]{1,})/?$', 'index.php?pagename=$matches[1]&paged=$matches[2]', 'top');
});
This will ensure WP uses the pagination rule prior to the post type query rules
Related Posts:
- Change the “page” slug in pagination
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Disable wordpress pagination URL rewrite for specific page
- URL rewrites and pagination
- Sorting archive pages with “pretty” URLs?
- add_rewrite_rule and pagination issue
- WordPress removes spaces in URL on pagination
- How to remove WordPress category from URL and have a custom pagination parameter/rewrite?
- Remove “/page/1” from the URL
- Disable Pagination on Pages
- Changed pagination URLS to use p= instead of paged=
- Adding a rewrite rule to page that has no fixed variables and pagination
- Not able to rewrite the pagination URL for the posts
- Add pagination to a template loaded by query variable
- Why is a rewrite rule in wordpress prevent pagination?
- WordPress pagination broken for page 2,3 with custom permalink. Redirects to baseurl
- Remove trailing slash
- Pagination posts. Url format
- WordPress total posts per page changed and now 404 Http error comes out [closed]
- Wrong rewrite rules
- WordPress is adding pagination for all pages like www.example.com/page/123. How to remove that?
- How to create a front end user profile with a friendly permalink
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- How do I remove a rewrite rule?
- Use subdomain for certain urls
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- Can I call a custom plugin with a direct URL
- Custom slug in front of search URL
- Display posts with author in the url with custom post types
- add_rewrite_rule() not playing nice with child pages
- rewrite_rule() not preserving the query string
- Appending numbers to url do not break the link
- Custom rewrite rules are sending everything to index.php
- How to Change Author Posts URL
- Change Attachment Post URLs to File URLs
- WordPress 404 unless there is a space in url
- Change permalink for default archive – yearly
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- Add .html extension to only one page in my WordPress site
- How to get “extended” path info from URL in a plugin
- Custom URL routing based on cookie value
- Rewriting rules: difference between ‘init’, ‘rewrite_rules_array’, ‘generate_rewrite_rules’?
- Multiple Permalinks for Same Post
- How to perform a query at the URL?
- url rewriting for most recent post
- Remove Query String from URL on Redirect – Redirection Plugin
- Cleanup URL for a custom page in wordpress
- Use custom template on certain URLs
- WordPress rewrite rules don’t need ^?
- custom template rewrite
- How to rewrite url wordpress?
- WordPress Redirecting Non Category Pages /page/nnn to their Canonical URLs
- How to create a profile page for specfic / custom user role members?
- How to remove trailing slash from root WordPress folder?
- Rewrite the default post object’s permalink
- How can I redirect product url to category then product url?
- WordPress search rewriting
- Enpoint Not Found in Rewrite Tag Permalink
- Custom Rewrite Rules
- URL Rewrite with Custom Variables
- htaccess rewrite, adding segment to url
- Custom Download Link
- Rewrite /category/cars into /topics/cars
- show ALL latest posts with archive.php on example.com/latest
- Adding a query string to only one page url
- Url rewrite with htaccess
- force www rewrite if wordpress put in a folder
- Current post ID – relative url
- How to use wp rewrite to hide form action url?
- Custom Structure permalinks error 404
- change the url in wordpress
- Redirect URL to an existing page with query string or #! added on
- how to move another machine or server without dealing with IP
- Add extra optional text to permalink e.g. “-with-*”
- change url for portfolio image
- Why are my paginated result links not working?
- remove archive from url :: marketpress
- add_rewrite_rule with optional parameters
- How to change url of specific posts with name of a root page
- Redirect empty search to another page
- WordPress URL redirect and replace ? question mark
- Change author base and slug in author link
- Rewrite rule not working, suspect redirect string
- Fresh install redirects to www, breaking page loads
- Rewrite Url using .htaccess or hook
- url restructure or rewrite having $_GET variables
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Error 404 wordpress redirecting URL
- What’s the best approach to do this?
- Font Page overrides rewrites
- WordPress Rewrite: Ignore Specific Pattern
- rewrite rule for home/index page
- WPNetwork with custom URL Rewrite rules
- URL Rewriting in WordPress
- Rewrite URL variable to custom path
- Own code on index.php wordpress theme file, help with the rewrite rules
- URL rewrites af
- How to change search url produced by ‘s GET method?
- Hide / rewrite download link
- Change url site.it/wordpress