Don’t delete a page or post – redirect

What happens when you delete a page?

If you delete a page or a post you will break any links to that addressLast week a client who wants to restructure some content on her site asked me “What happens when a page is deleted?”

The answer is that if you delete a page or a post you will break any links to that address.

As there is no web page to display, the web server sends a page that simply says “404 Page not found”. 404 errors can have a negative effect on your websites search ranking and can be frustrating for site users.

The answer is to create a 301 redirect.


 

***UPDATE****

Yoast has removed the 301 redirect option from the free plugin so this section of the post has been removed. You need to purchase the WordPress SEO Premium plugin to have access to the redirect manager.


How to create a 301 redirect without a plugin

You don’t need a plugin to create a 301 redirect if you are comfortable editing files. One line added to your .htaccess file will create a redirect.

redirect 301 /old/old.htm http://yoursite.com/new/

  • replace /old/old.htm with your old url. Do not include http or www. Include the full path from the top level of your site to the page
  • replace http://yoursite.com/new/ with the full path including http:// (www is optional) to your new page. Include a trailing slash (/) at the end of your url
  • put each redirect on its own line.

You can read more about how to add 301 redirects in the .htaccess file here.

One comment on “Don’t delete a page or post – redirect
  1. Thanks Ruth. Yoast’s plugin solves a dilemma for those of us who don’t have enough knowledge to create 301 Redirects and need to alter our website info. And your post clearly outlines how to use the plugin without stress.

Leave a Reply

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

*