WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 4 months ago

#26269 new enhancement

register_taxonomy should accept has_archive

Reported by: mattbeck Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

Taxonomies can and should be used by custom themes/plugins to connect posts/pages together.

It's not always desirable to expose this relationship publicly with an archive view, and if overlooked can cause undesired results or content duplication issues in search engine indexes.

Following the same process as registering a custom post type, the register_taxonomy function should accept the has_archive bool.

Change History (2)

comment:1 nofearinc4 months ago

What would be the difference with the has_archive argument for register_post_type calls?

comment:2 mattbeck4 months ago

Taxonomies are not always tied to a specific post type, and they have their own archive pages.

Those archive pages should be disable-able.

Currently if you don't want to expose the taxonomy's archive page, you have to set up a 301 or some such.

Note: See TracTickets for help on using tickets.