When you register the post type, set the argument 'has_archive'
to a string, in your case plugins
.
The doc block for register_post_type()
says:
@type bool|string $has_archive
Whether there should be post type archives, or if a string, the
archive slug to use. Will generate the proper rewrite rules if
$rewrite
is enabled. Defaultfalse
.
Minified example:
register_post_type( 'plugin', [ 'has_archive' => 'plugins' ] );
Related Posts:
- How do you create a “virtual” page in WordPress
- Rewrite rules not working in WordPress
- How do I add a server-independent external rewrite rule?
- How to prevent redirection to max 2147483647 for larger values of the page query variable?
- How to create the pseudo static rules of the page I created
- how to add prefix to post url structor only
- How do I remove a word from a url in WordPress using .htaccess?
- WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)
- Rewrite Rule for Custom Page with Query Vars in URL
- wp_sanitize_redirect strips out @ signs (even from parameters) — why?
- WP Rewrite the last two parts of the URL
- Change default URL of image attachment
- Rewrite URL to remap WordPress Permalink
- WordPress redirection to get url friendly
- Access $_POST data after redirect
- Change Query String to pretty permalink
- How to add a custom redirect rule for subdomains?
- How to remove WordPress category from URL and have a custom pagination parameter/rewrite?
- rewrite rules for custom post-type with a custom taxonomy
- Remove special characters in a URL
- append url parameters to all links
- Load a template page based on part of slug in wordpress
- Alias ‘wp-content’ directory to something shorter (framework?)
- Is it possible to rewrite URLs in this situation?
- open all .docs in word online
- url rewrite parsing a custom url parameter not working
- How to add custom variable in url without redirect?
- Using category slug in add_rewrite rule
- Adding pretty query parameters
- Pass a comment id through url and append the comment post’s slug in the url
- How to change the main site url on a multisite installation (network)?
- Problem with add_rewrite_rule
- add_rewrite_rule ignoring other params than the “p” param
- optimize wordpress rewrite rule regex
- How to catch Rewrite rules then display a specific post?
- Adding two rewrite rules
- Load an url with minimal/no DB queries
- Login page is redirecting to homepage
- .htaccess rewrite
- Auto generate rewrite rules for multiple taxonomies
- Generating a Rewrite Rule for sSecific Post-Requests from a Submitted Form?
- Change htaccess to redirect to index.php in subfolder
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- URL Rewriting for PHP script on an image URL
- How to redirect specific URL to Subdomain
- How to rewrite wordpress urls with index.php in them
- Force search form to go to clean url without multiple redirects
- Rewrite query string to path
- map multiple URLs to display home page without changing URL displayed in browser’s location bar
- Rewrite API -Adding a parameter before the slug
- Rewrite URL based on home_url
- Replace term archives with static pages
- Why does my URL rewriting only work using two different methods?
- Using a custom 410 page
- IIRF + IIS 6 + WordPress does not return 404 error
- Rewrite vs Redirect from ?p={ID}
- Is it possible to set the same base for categories and tags?
- Adding a rewrite rule to page that has no fixed variables and pagination
- Flush rewrite rules on option update with Settings API
- Integer based rewrite isn’t recognized for value of 1
- Re-directing URLs with dates to URLs without dates
- Having WordPress control only certain pages with .htaccess?
- wordpress url correction
- Help with a custom rewrite
- My bbPress rewrite rules aren’t working
- Not able to rewrite the pagination URL for the posts
- add_rewrite_tag works for some parameters but does not for others
- Rewrite specific action url
- Using URL rewrite to add custom URL for custom post type
- 301 Rewriting htaccess
- Rewrite rule shows 404 page
- How to transform multiple parameter URL to clean URL
- Exclude subfolder in WordPress permalink
- wordpress path generation from rewrite rule
- How to add dot(“.”) in post slug
- Rewrite rule for custom permalink structure
- Help with .htaccess setup to hide WordPress Directory
- Ugly URLs when there’s pagination
- Unable to access the query variables in the template
- Hide wordpress source code
- Why is there a 404 on page 2+ for my search page?
- Custom rewrite from URL to URL using slug
- URL duplicating after migrating domain
- URL rewrite before template_redirect called
- Properly maintaining an old rewrite structure
- Custom Post type and Custom taxonomy with URL rewrite worked but template did not
- Add dynamic url with external page in WordPress
- .htaccess RewriteBase equivalent for WordPress – Passing a URL as a variable without getting a 404
- URL Rewrite for CPT single posts
- Using 2 URL’s for WordPress
- Rewriting WordPress URLs
- Need Help With A Rewrite Issue
- Function to rewrite URl in WordPress
- How can i maintain permalink structure and avoid a 404 error when loading external content?
- Can’t get pretty permalinks to work without index.php
- How to rename the WordPress wp-login.php running on IIS6?
- get parameter from url rewrite [closed]
- Generated URLs don’t reflect accurate URLs.
- Rewrite rule to simulate page hierarchy results in 404
- add_rewrite_rule not working with custom variables