Forums

Adding a prefix to taxonomy slugs (3 posts)

  1. pealo86
    Member
    Posted 8 months 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 7 months ago #

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

  3. pealo86
    Member
    Posted 7 months 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?

Reply

You must log in to post.

About this Topic