I have a sports website that will have very similar slugs:


Sooner than later, teams A and B will play again, and the slugs will repeat themselves:


The solution I found was to prepend a date to the match, making it look like this:


This will guarantee I have unique slugs and is also user friendly.

I tried to change "rewrite" option on register_post_type without success, because whatever I add there will be the same for all "match" post types.

How can I append the scheduled post date to the slug?

  • How about creating a custom post type with a taxonomy? Where the CP is match and its tax. is teamA vs teamB
    – klewis
    Feb 1 '17 at 3:16
  • There's a lot of related questions around this. I think this answer stackoverflow.com/a/23702560/450127 (or a modification of it) will do what you want.
    – Ian Dunn
    Jan 20 '18 at 20:29

I ended up using Custom Post Type Permalinks plugin

Works pretty well:

Append date to custom post type wordpress

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.