Had a page called locations at mysite.com/locations/. Renamed it to /locations-old/ and created a new page also at /locations/. Ran into redirect issues and permanently deleted /locations-old/. However /locations/ returns as 404.

If I change my permalink settings to plain (/?p=123/), or if give the page a parent (/foo/locations/) the page works fine. If i change the slug name by a single letter the page also works.

I've tried everything I can think of and research to fix this problem including resetting permalinks, using flush_rewrite_rules(); (with and without changing my .htaccess permissions), deleting and remaking the page, deleting old page from database and optimizing my site.

My .htaccess is clean since this is a dev site.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

One interesting item of note is I used var_dump($wp_query); on my 404 page and it returns a page id of the original /locations/ page even though I've removed it from wp_posts.

How do I fix this 404 and serve up my page correctly?

1 Answer 1


Check your database, in the postmeta table, for meta_key _wp_old_slug. When you change a slug, WP stores it and automatically redirects the old to the new, which sounds like the reason you initially couldn't access /locations/.

Once you delete the postmeta, visit Settings > Permalinks for good measure (this refreshes permalinks) and try either using an incognito window or a HTTP header checker to verify whether the /locations/ URL is working as intended. Your browser caches redirects, so just checking in a regular window is likely to be misleading.

  • I seem to have a different problem. All the rows with meta_key _wp_old_slug refer to pages that are completely separate from my /locations/ problem.
    – upwut
    Jun 14, 2017 at 22:19
  • Are you checking the URL in an incognito window or a HTTP header checker? Browsers cache redirects.
    – WebElaine
    Jun 15, 2017 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.