I’ve been learning about taxonomies, custom posts etc though a lot of trial and error. I finally have it working how I want, however now I am getting some conflict with my desired slugs. I can’t name my category “venue” because someplace in the database, that’s already taken (I assume) – even though I’ve deleted the category that used it. Now when I try adding the category that I want to use the “venue” slug, WP automatically makes it “venue-2”, which I definitely don’t want in my url as the folder. Any suggestions for this?
Leave a Reply
You must be logged in to post a comment.
This can also be caused by uploading images with the same file name as the post/page. In my case, I uploaded an image called ‘careers.jpg’ before I created a page called ‘Careers’, so the page was getting the ‘-2’ appended. To fix it, I just changed the slug on the image, then I was able to change the slug on the page.
The slug is stored in the
post_name
column of yourposts
table. I’d recommend searching that table first before manually assigning that slug, though.There is another cause for WordPress appending
-2
at the end: When the slug only contains numbers. This is not allowed.Example: I wanted to name my page
2016
and even though there has never been a 2016 in the database the slug always turned into2016-2
.As far as I remember this is because numbers have a special meaning for workpress (path variables) and they couldn’t be distinguished.
So my solution was to manually rename the slug to
year-2016
which looks nicer than this “-2” suffix.Usually when WordPress appends the “-2” to a slug, that means you still have the old content, that you meant to delete, in the trash. Be sure to empty your wordpress trash, then try making the slug.
To access the pages in the trash, open the Pages / All pages menu, then click on the “Bin” section that appears on the right hand side of the “All” section. Note that if there is no items in the bin, this section will not appear.