Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9848 closed defect (bug) (worksforme)

Using custom taxonomies breaks permalinks created by the_tags

Reported by: markel Owned by: filosofo
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Taxonomy Keywords: taxonomy, custom, tags, template, permalinks, the_tags
Focuses: Cc:


Using instructions found here I created a small plugin file to add a custom taxonomy to a 2.8b1 installation. The code was:

add_action( 'init', 'create_my_taxonomies', 1 );

function create_my_taxonomies() {
	register_taxonomy( 'guest', 'post', array( 'hierarchical' => false, 'label' => 'Guests', 'query_var' => true, 'rewrite' => true ) );

After activating this, I created a post with four taxonomy terms under the new guest taxonomy type. I also gave the post a handful of standard post_tag taxonomy terms and one category.

When the post is displayed in the default theme (or any theme, for that matter), the_tags generates the list of post_tag terms, but the permalinks they point to have the new /guest/ taxonomy string rather than the /tag/ string they should have.

e.g. the Post Tag "whatever" is now generating


rather than


All the post tags added to the post are showing (correctly) in the term_taxonomy database table as post_tag entries and not guest entries.

Deactivating the custom taxonomy plugin does not return the generated links to normal. It is also broken in any new post, even a new post created without any of the custom taxonomy terms.

Change History (2)

#1 @markel
7 years ago

  • Resolution set to worksforme
  • Severity changed from critical to normal
  • Status changed from new to closed

Mystery solved: the "tag base" option in Settings > Permalinks was pointing to "guest" as a string, but I don't remember changing it.

Changing the tag base back to "tag" solved the problem, in any case.

#2 @Denis-de-Bernardy
7 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.