Rewrite Slug for CPT Archive Pages to Plural Name of Slug

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. Default false.

Minified example:

register_post_type( 'plugin', [ 'has_archive' => 'plugins' ] );

Leave a Comment