WordPress not remembering old slugs for pages

WordPress keeps track of post slug change with wp_check_for_changed_slugs() function. The old slugs are saved in wp_postmeta table with _wp_old_slug meta_key and later redirects to current URL with wp_old_slug_redirect() function. That’s why even after changing a post’s slug, you get redirected to the correct post. However, WordPress doesn’t do this by default with pages (or … Read more

wp_redirect() doesn’t work

The problem is not what you are doing, but when you are doing it. When your browser requests a webpage, that webpage arrives with a set of HTTP headers, followed by a HTTP body that contains the HTML. Redirection is done via a HTTP header. The moment you echo, or printf or send any form … Read more