How to properly delete a page from your site

Whenever you delete a page (or post) from your site, you also delete one or more URLs. That old URL, when visited, will usually return a ‘404 not found’ error, which is not the best thing for Google or your users. Is that what you really wanted to happen? You could redirect that deleted page to another page, or maybe – if you really want the content gone from your site – serving a 410 header would actually be a better idea. This post explains the choices you have and how to implement them.

Did you know Yoast SEO Premium has an awesome redirect manager that makes the redirection of deleted posts a breeze? Try it out!

Redirect or delete a page completely?

The first thing you have to work out is whether or not the content you deleted has an equivalent somewhere else on your site. Think of it this way: if I clicked on a link to the page you deleted, would there be another page on your site that gives me the information I was looking for? If that’s true for most of those following the link, you should redirect the deleted URL to the alternative page.

In general, I’d advise you to redirect a page even when only a handful of the visitors would benefit from it. The reasoning is simple: if the other option is for all your visitors to be sent to a “content not found” page, that’s not really a great alternative either…

Create a redirect

There are several types of redirects, but a 301 redirect is what’s called a permanent redirect, and this is what you should use when you redirect that deleted page URL to another URL. Using a 301 redirect means Google and other search engines will assign the link value of the old URL to the URL you redirected your visitors to.

Deleting content completely

If there really is no alternative page on your site with that information, you need to ask yourself whether it’s better to delete it or keep it and improve it instead. But if you’re absolutely sure you want to delete it, make sure you send the proper HTTP header: a ‘410 content deleted’ header.

404 and 410 HTTP headers

The difference between a 404 and a 410 header is simple: 404 means “content not found”, 410 means “content deleted” and is, therefore, more specific. If a URL returns a 410, Google knows for sure you removed the URL on purpose and it should, therefore, remove that URL from its index much sooner.

Our Yoast SEO Premium plugin for WordPress has a redirects module which lets you set 410 headers. The redirect manager is the perfect tool for working with redirects, automatically asking you what you want to do with a URL when you delete it or change the permalink. Of course, you can set any type of redirect.

The problem with serving 410 content deleted headers is that Google’s support for it is incomplete. Sure, it will delete pages that serve a 410 from its index faster, but Google Search Console will report 410s under “Not found” crawl errors, just like 404s. We’ve complained to Google about this several times but unfortunately, they have yet to fix it.

Collateral damage when deleting a page

When you delete one or more posts or pages from your site, there’s often collateral damage. Say you deleted all the posts on your site that have a specific tag. That tag now being empty, its archive’s URL will also give a 404. Even when you handle all the URLs of those posts you deleted properly (by redirecting or 410ing them) the tag archive will still give a 404, so you should make sure to deal with that URL too.

Even when you didn’t delete all the posts in a tag, the tag archive might now have 5 instead of 12 posts. If you display 10 posts per page in your archives, page 2 of that archive will now no longer exist, and thus give a 404 error. These aren’t the biggest problems in the world when you delete one or two posts, but if you’re dealing with a Google Panda problem and because of that deleting lots of poor content, creating a lot of 404s like this can take your site down even further, so proceed with care!

Read more: Which redirect should I use? »

Take your technical SEO to the next level

  • Get Technical SEO & Structured data training
  • Hands-on advice for your technical setup
  • Save $$ by buying both Yoast courses
  • Start online when you are ready for it
More info

25 Responses to How to properly delete a page from your site

  1. amit
    amit  • 3 months ago

    Thanks for this useful article. I always forgot to check the collateral damage. Usually, I will redirect the deleted page link to homepage if no equivalent content found. Is this a good practice or better use 410?

  2. Jeroen
    Jeroen  • 4 months ago

    Hi guys,

    We are using the Yoast premium plugin for our new website in WP, currently the site is in Drupal. The ‘old’ site contains 3000 URL’s of which at least 50% are old news articles with no value anymore, they don’t have back links and a very low number of visiters.
    We have to import all articles in WP, however, would this be a wise idea? To import 3000 articles and later on delete at least 50% of them in WP? Or should I redirect all of them to the ‘new’ news section?
    The articles are contentwise bad, so I do prefer not to import them and thus delete them all.

    • Willemien Hallebeek
      Willemien Hallebeek  • 4 months ago

      Hi Jeroen, If you have Yoast SEO premium running, like you say, importing and directly redirecting them (301) is best. With the redirect manager, you’ll have a relatively easy workflow to do so (but it will still take some time). Good luck!

  3. Niya
    Niya  • 4 months ago

    Hi,
    My site was hacked. Thousands of Japanase key word links were created. Now Site is clean from those. But search result showing those links.

    How can i remove all those from search result?

    Thanks

    • Willemien Hallebeek
      Willemien Hallebeek  • 4 months ago

      We’re so sorry to hear that, Niya. What you could do, if your site is clean, is ask Google to recrawl your site. There are a couple of methods you could use, you can find them here: https://support.google.com/webmasters/answer/6065812?hl=en Hope this helps!

  4. Naziman Azlye
    Naziman Azlye  • 4 months ago

    Thanks for this useful article. I always forgot to check the collateral damage. Usually, I will redirect the deleted page link to homepage if no equivalent content found. Is this a good practice or better use 410?

    One more question, if I dont want delete the page but still want the link, so I change all the writing inside the page. Not some but all but still same topic. Is it this way also good practice?

    Thanks in advance for your answer.

    • Willemien Hallebeek
      Willemien Hallebeek  • 4 months ago

      Hi Naziman, I’d advise to only use a 410 if you really want to show that you had this page, but now removed it. Otherwise, just 301 to the homepage (when there is no better option). And your second question: If you rewrite the post or page that’s ok, just make sure it makes sense for the people who followed the links to that page: does the content still meets the expectations they have?

  5. Kapil Garg
    Kapil Garg  • 4 months ago

    Thanks for this useful article. A common problem of website owners is solved.

  6. Strip Curtain Solutions
    Strip Curtain Solutions  • 4 months ago

    Good day Yoast ppl and readers

    The dreaded 404 is well known, and most of us know you should do a 301 redirect. But I must admit I didn’t know about a 410 content deleted header. Yoast is truly an awesome plugin!

    Thanks

    Eddie

  7. Per Karlsson, BKWine
    Per Karlsson, BKWine  • 4 months ago

    Interesting. Thanks. Did not know about 410. Could be a good reason to go premium, to use the redirect manager.

    Is the Yoast redirect manager compatible with the WPML multilingual plugin? (Some other redirect managers aren’t.)

    • Hanneke
      Hanneke  • 4 months ago

      Hi Per,
      If you don’t use regex redirects and do use the Yoast SEO WPML glue plugin you should be fine!

      Hanneke

  8. Sharon Anderson
    Sharon Anderson  • 4 months ago

    How do you send a 410 HTTP header?

    • Hanneke
      Hanneke  • 4 months ago

      Hi Sharon!

      Thanks for asking, our Yoast SEO Premium plugin for WordPress has a redirects module which lets you set 410 headers. After deleting a post or page our plugin will ask you directly what you’d like to do with the old URL!

      Hanneke

  9. Fandy
    Fandy  • 4 months ago

    “If that’s true for most of those following the link, you should redirect the deleted URL to the alternative page” this meant I must change the redirect link to an active link right?

    • Hanneke
      Hanneke  • 4 months ago

      You should redirect the deleted page to an active page, indeed!

      Hanneke

  10. Don McKenzie
    Don McKenzie  • 4 months ago

    I want to delete the page today. But what if I want to re-add the page later or add a page with the same slug, does the Yoast Premium plugin recognize this and remove the 410?

  11. Esther
    Esther  • 4 months ago

    Great blog. Bookmarked for future reference!

    • Hanneke
      Hanneke  • 4 months ago

      Hey Esther! Glad to hear that you like our post!

  12. Andy Roessler
    Andy Roessler  • 4 months ago

    Without buying the Yoast plugin, and you want to delete a page, could you just delete page and use Google Search Console (old one) Link Removal and submit it to Google index for removal?

    • Edwin Toonen
      Edwin Toonen  • 4 months ago

      Hi Andy. You could, but that’s a really cumbersome — and error prone — way of getting this done. Plus, it’s temporary by default and takes quite some time, and you have to put in extra work to get the deletion to become permanent. It is much easier and safer to let a plugin do this for you. Just remember the process as described above. Good luck!

  13. Alisa
    Alisa  • 4 months ago

    Thanks for the useful article! I always read your tips with interest!

    • Hanneke
      Hanneke  • 4 months ago

      Hi Alisa,

      happy to hear that you like our posts and tips!

      Hanneke

  14. Travis Pflanz
    Travis Pflanz  • 4 months ago

    Will you discuss the SEO ramifications of having lots of URLs that return 404 errors on your website. Google has stated that 404 errors do not have any affect on the overall ranking of a website. Does your data show any different?

    • Edwin Toonen
      Edwin Toonen  • 4 months ago

      Hi Travis. Every site has 404 errors and Google knows this. It’s not necessarily bad to have them. It could become a problem when the number of 404s gets out of hand or increases rapidly. This might be a sign that something is amiss. Sometimes, it’s a sign of bad maintenance. And Google might say that having 404s doesn’t really hurt, but your CTR might say otherwise. Having a user hit a 404 is just a really bad user experience and that might truly harm your performance. Here’s a post on how to deal with 404s: https://yoast.com/404-error-pages-checking/