This post will explain how to delete a page in WordPress, correctly, if you want to preserve your SEO ranking and keep your readers happy.
The problem: Why you shouldn’t just delete a page and forget about it.
There are two reasons you shouldn’t just delete a page and forget about it.
Reason 1: It affects your SEO because unless you tell Google your page has been deleted, Google will still think your page exists. When you delete a page from your website that Google has already crawled and indexed, Google will still try to crawl that page. Only, when it’s deleted, your website will return a status code of ‘404 page not found’.
Google sees this code and will continue to try and crawl your page. It doesn’t know you’ve deleted the page. Having too many pages return a 404 message can negatively impact your SEO.
Reason 2: It affects your users experience. When a user is faced with a page that says 404 page not found, what should your user do? For the best user experience you should be providing content on your 404 pages to help your reader stay on your website and find the content they were looking for.
So, if you want to keep Google happy and provide the best user experience for your readers you need to know how to correctly handle deleted content.
What are status codes?
Before you can fully understand why you shouldn’t just delete a page you need to understand a little bit about status codes. Status codes are the messages your website pages return when a browser tries to load them. You may have seen when a page doesn’t exist you see a 404 page doesn’t exists response. 404 is a response code in the response header that tells the the user the page doesn’t exist.
Correctly deleting a page from your website means correctly setting the status code according to how you want the deleted content to be handled.
The main status codes you want to be concerned with is a 301 and 410 status code.
A 301 code means your content has been redirected.
A 410 code means your content no longer exists.
To preserve your SEO rankings and give a great user experience you need to correctly set status codes.
5 step process for how to delete a page in WordPress while preserve your SEO ranking
Step 1: Identify whether your content needs to return a 301 or 410 status code.
There are two ways you can deal with your deleted content.
Method 1: Delete the page then use a 301 redirect to redirect traffic to the next best page. You will use a 301 if the page you are deleting;
- Has traffic and you want to pass the SEO value of that traffic onto another relevant page.
- Can be replaced with similar content.
Method 2: Delete the page then use a 410 status message to signal the content is permanently removed.
You will use this if you have no other similar content you can redirect to.
Step 2: If you want to return a 301 status code, identify which page you want to redirect to.
Avoid redirecting to the home page as this just causes confusion.
Choose the next best piece of content, if there isn’t anything then a 301 redirect isn’t the best choice. You need a 410.
Step 3: Identify how you will implement your redirection.
RankMath includes 301 and 410 redirection in their free plugin. Yoast needs the premium version. Did you know – If you are on my SEO maintenance plan you will get the RankMath Pro plugin included!
Step 4: Add the redirect.
Follow the instructions given by the plugin you are using. Redirections are really simple to set up.
Step 5. Test the redirect.
Ensure that if you are returning a 410 status code that you have a page set up to handle traffic.
Not sure how to set up status code pages? Read my blog on setting up status code pages here.
To preserve your SEO and provide a great user experience, you need to handle deleted content properly by setting the correct status code.
This is really simple to do in WordPress with any good SEO plugin.