Deleted Page Still In WordPress Database

There is a function that is looking for duplicated post names: wp_unique_post_slug.

In this function are few queries, and one of them is looking for duplicated post names: SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1. If this query will return some rows then function will add suffix to post name. So you have to have some post with identical post name and post type, but with different post id than this one, which you are editing.

You can check this by editing this query and executing it in phpMyAdmin for example. This should looks like this:
SELECT post_name FROM wp_posts WHERE post_name LIKE "your_post_name%"
You need to change wp_ to your tables prefix and your_post_name to your post name (percent sign is important)

wp_unique_post_slug on trac

Leave a Comment