Back
Finally, I’ve Removed the Dash Number from My Pages
Problem
I wanted my Blog, Certifications, and Projects pages to have the slugs /blog, /certifications, /projects respectively. Instead, they were /blog-2, /certifications-2, and /projects-2 for some unknown reason.
I have tried to figure this out off and on for a few months. Each time, spending an hour or less before moving onto something else.
Steps Taken
Originally, I thought that even though I couldn’t see the “Trash” tab in Pages of my WordPress instance, that old pages must be in there.
I looked through all the posts ensuring that none of them were using the names I wanted. And tried other methods discovered by searching Google.
Solution
Today, I had the bright idea of searching the database for what could be using the names that I wanted to use for my pages. Looking in the wp_posts table, I found my problem.
I found attachments that were using the names I wanted for my pages. This discovery allowed me to quickly go to my site’s Media folder, find the offending attachments, and rename them. You can see above that the blog attachment is now named blog-image. Previously, it was named blog.
Steps to update attachment slug:
- Click Media
- Click the item you want to update
- Click “Edit more details”
- Click “Screen Options” and select “Slug”
- Scroll down to “Slug” and enter new slug value
- Click “Update”
- Verify the change by scrolling to and viewing the “Permalink”