Reputation: 369
Hi have the page 2825 with url slug 2825-2 and i cant change for 2815(only) how i can change?
Upvotes: 0
Views: 2805
Reputation: 423
The post ID is an auto incremented primary key in the database so you will not be able to roll it back.
Your best bet might be to look into a different permalink structure.
Upvotes: 0
Reputation: 14312
There are a number of reasons this could be happening, not just because you already have a post or page with this slug:
After it has been deleted permanently from trash:
Flush your Rewrite Cache:
There are Three Ways to Flush the Rewrite Cache in WordPress:
flush_rewrite_rules();
in your functions.php (only add it temporarily - you don't want it to run all the time).SELECT * FROM wp_options WHERE option_name = 'rewrite_rules'
option_value
. See Three Ways... for more info.Delete old WP permalinks
If its still not working, run this query in your database to clear all the old slugs from the postmeta
table:
DELETE FROM wp_postmeta WHERE meta_key = '_wp_old_slug';
Ref 'Remove Old Permalinks?'
Note: Back up your database before you make any changes in there directly - any mistakes could break your site.
Upvotes: 2
Reputation: 534
You can't change the URL to just be /2815 because there already exists a page, post, or category with the slug. That is why it added the '-2' to the end of the URL.
I would find that page and either update or delete it, then change the URL with the -2 to just be 2815 instead of edit it from the backend to cause a conflict with the existing page, post, or category
Upvotes: 0