Ever had a page or post in WordPress that you wanted to name a certain name and whenever it saved, it appended it with “-2” or “-3”? Example, I was trying to create a forum page with Mingle in WordPress and so I was naming my page, domain.com/forum. However, because of earlier trials I had already once had a forum page, which I had deleted.
Delete Permalink in WordPress
Method 1: Remove Permalink using DB GUI
Deleting the page didn’t delete the permalink that was created. So when I tried making the page again I ended up with domain.com/forum-2; which is not what I wanted. Below are some simple instructions on how to delete permalink in WordPress.
Step 1
You need to login to phpMyAdmin, so you can get access to your WordPress database. If you have Cpanel, the link to phpMyAdmin is located under the “Databases” header.
If you don’t have Cpanel, check with your webhost for the URL for phpMyAdmin.
Step 2
Once you are in phpMyAdmin, highlight and click into your WordPress database in the top left. In my example, I have a db called db_wpexampledbizxf7.
Step 3
On the left hand side, scroll down and click into wp_posts.
Step 4
Click on the Search tab and under the post_name row enter in the name of your old permalink page name you are trying to find and delete. In my example, I am entering forum because I want to delete it, so I can again use it. Once entered, click “Go” in the bottom right.
Step 5
If multiple rows return with that name, look for the one that says trash under the post_status. Most likely only one row will return, and so that is the one we want to delete.
To delete it, click the checkbox for that row, and then click the red X Delete link (or click on it right away without checkbox).
You can also select several necessary lines using the checkbox and click the same Delete link at the bottom of the list. The action will apply to all of them.
Step 6
Now go back to your page/post that you are wanting to name, and you should now be able to use that name. For example, when I created a page, I was now able to use domain.com/forum.
Method 2: Deleting via SQL Query
The same operation can be done using the CLI by executing a specific SQL query. This method is suitable for remote administration cases. Here it’s enough to search for all posts where the post_status field contains ‘trash’.
- Log in to the mysql console (or any other Database management system) via any terminal;
- Choose your base;
- Run the following command:
DELETE FROM `wp_posts` WHERE `post_status` = ‘trash’;
Method 3: Using WP Extensions
Today WordPress offers automated tools in the form of extensions for working with broken and old links to content of any type.
Among them are two of the most effective:
- Remove Old Slugs. Allows you to perform the entire operation of removing permalinks posts from the database in one click.
- Broken Link Checker. Controls links to posts, pages, comments and other fields with addresses; detects broken links and reports them on the dashboard.
- Lens Kubernetes IDE – Opensource Lens Desktop - January 27, 2023
- Using Select-Object Cmdlet in PowerShell - January 26, 2023
- How to Turn Off Siri Suggestions on iPhone? - January 25, 2023
Thankyou so much for saving me valuable time with this tip. I couldn’t work out why my deleted pages prevented me from using the WordPress permalink names that I wanted to – even after clearing the trash.
Your welcome!
Appreciate the information! I had to sift through 8 or 9 other websites on this issue before I finally found this helpful information. All other sites gave the novice answer of ‘delete permanently from trash’. No offense, but that is pretty obvious. I knew it had to be some lingering data in the database. This was a great tutorial – thanks again!
Great! Glad we could help out.
Thanks a million. This is exactly what I needed and wanted.
OH MY GOD
Thank You!
No way I would have found this on my own, i had broke my site permalink adding https and couldnt access anything; and searched in the wp directories for 30 minutes finding nothing
Great, great, great help!! Thanks a lot!