WordPress.org

Ready to get started?Download WordPress

Forums

Adding a prefix to taxonomy slugs (3 posts)

  1. pealo86
    Member
    Posted 2 years ago #

    Let's say my client will be adding a category (through a custom taxonomy called 'Location') called 'Greater Manchester'.

    I'm wondering if there is a way I can set up the taxonomy so that, rather than setting the slug as 'greater-manchester' it adds a prefix to it automatically, something like:
    'top-greater-manchester'

    Is this possible through the way the taxonomy is configured in functions.php?

  2. ndrwld
    Member
    Posted 2 years ago #

    You can do this by creating rewrite rules.
    Take a look here.

  3. pealo86
    Member
    Posted 2 years ago #

    Thanks. The main reason for adding the prefix however is so that WP doesn't add a number at the end of any duplicate taxonomies.

    I'm not sure rewrite rules would solve that though?

Topic Closed

This topic has been closed to new replies.

About this Topic