301 Redirect: Don’t just delete a page or post → redirect

Restructuring your website doesn’t need to cause errors. In this post we’ll show you how to create what is known as a 301 redirect.

What happens when you delete a page?

301 redirect SEO tutorial | Don't just delete a page or a post -> redirectLast 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 or a category  you will break any links to that web 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 website’s search ranking and can be frustrating for site users.

Prevent errors in the first place.

Think twice before you delete content. If the blog post is old, consider rewriting it, keeping the permalink unchanged.  If you significantly change the post content you can update the publish date, as we have done with this post.

How to safely delete content from your site

Don’t just delete content from your site → redirect the user to a new URL where the content now lives or where they can find related content.

A 301 redirect is a permanent redirect telling the browser and Google, when a site visitor tries to access this URL, send them to this URL instead.

During the restructuring process, make careful note of all pages, posts, categories and tags you are deleting. Search engines index archive pages so you need to include the URL for any deleted categories and tags in your list for redirection as well.

Don't just delete #WordPress pages/posts → redirect to where content is now or to related contentClick To Tweet

How to create a 301 redirect in WordPress

Not only do you not need a redirection plugin to create a 301 redirect, but you shouldn’t use one. Most WordPress redirect plugins store 301 redirects in the WordPress database. Writing redirects to the WordPress database will make your site significantly slower. And page speed is important—-important for SEO and for user experience. 

It is preferable to create 301 redirects in your website’s .htaccess file. The .htaccess file loads before the WordPress database, making the redirection faster.

Use The Yoast SEO Plugin to create a 301 redirect in the .htaccess file

To access your .htaccess file use the Yoast SEO plugin.

SEO → Tools → File editor

This tool allows you to quickly change important files for your SEO, like your robots.txt and your .htaccess file.

In the .htaccess file add a redirect for each page you want to redirect.

Screenshot how to create a 301 redirect in the .htacess in WordPress

redirect 301 /old https://yoursite.com/new/

  • replace /old.htm with your old URL. Do not include https:// or www in the old. Do include the full path from the top level of your site to the page
  • replace https://yoursite.com/new/ with the full path. Match the site address URL exactly as found on your site’s Settings → General page — including http:// or https:// or www. Include a trailing slash (/) at the end of your URL
  • when updating permalinks include your focus keyword
  • put each redirect on its own line.

You may need to clear your site cache to see the 301 redirect in action.

Extend the Learning….

4 thoughts on “301 Redirect: Don’t just delete a page or post → redirect

  1. Hi Ruth, im the owner of bb10apps.com a website that reviews applications for blackberry 10. Im in the middle of moving my entire website from bb10apps.com to blackberryapps.com I wanted to ask you what the difference between using Yoast 301 redirect in the advanced Tab is vs writing them in the .htaccess file. I have been using the advanced tab for redirecting all the articles I have. I pretty much cloned the website. so now articles are for example bb10apps.com/post-title now is blackberryapps.com/post-title. So I went to each article in bb10apps.com and under the advanced tab redirected each article to the corresponding one at blackberryapps.com I just want to know if that is the way I should do it. I did about half my posts which is about 150 and it works, but when I used FTP to download the .htaccess file there were no redirects on the file. So I dont know how yoast is making them redirect? and if I should be using the plugin vs writing them inside the .htaccess file. I hope you can help me out 🙂

    1. Hi Ron,

      Yoast has moved this feature to his premium plugin you’ll want to make the changes directly in the .htaccess file. You can edit the .htaccess from the Yoast plugin using “Edit Files” or using FTP to download the file add all redirects and then upload the file again.

    1. @tukang You mean move to .html to .htm (for example?). WordPress is dealing the permalink change by himself by putting 301 redirects

Leave a Reply

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