How to redirect a single post with WordPress
If you’d like to redirect a single post you can use this simple code snippet I wrote to redirect a single post to any other post on your WordPress website. I use a very similar snippet of code here on thisismyurl.com to redirect 404 pages (page not found errors), as well as several custom URL’s that I maintain for marketing and other vanity purposes.
Why redirect a single post?
Sometimes we choose to delete a post, change the URL structure, or simply no longer want a web page on our website. Ideally, the web would simply forget about those pages but realistically, there’s no way of knowing if that old website address has been indexed or included in an old email, so instead it’s a great idea to forward the old single post to a new URL on our website.
How do I redirect a single post?
There are a few ways to redirect an old web page, but essentially there are two Internet protocols for telling external search engines to ignore, or redirect old content.
- a 301 redirect, which is a status code a website can send, along with a new URL to tell visitors that the new web address is the temporary redirect address;
- a 302 redirect, which works the same as a 301 except that it tells a client to permanently redirect to the new address;
Both of these methods will work to redirect a single post to a new location on your website.
Remember to read my tutorial on how to create a site specific plugin file to add this to your WordPress website easily!