Private post caught in endless redirect loop

I have an old post set to private. When I visit it in a browser, Network in DevTools shows that it is endlessly redirecting to itself. I have switched off my redirect plugin, that didn’t help.

I wondered if it was a canonical redirect, so I tried this in functions.php:

remove_filter(‘template_redirect’, ‘redirect_canonical’);

No success, so I tried:

remove_action(‘template_redirect’, ‘wp_old_slug_redirect’);

And, that has fixed it. However, I then checked for old slugs:

SELECT * FROM `wp_postmeta` WHERE `meta_key` = ‘_wp_old_slug’

There is no entry with the relevant post_ID?! How do I fix this one page?

Read more here:: Private post caught in endless redirect loop

Leave a Reply

Your email address will not be published. Required fields are marked *