Reaction’s Approach to WordPress Development
We’re Reaction Digital, a remote website and branding agency based in Alberta, Canada. We understand that a robust online presence […]
Have you ever encountered a strange page on your WordPress site that looks like it’s come back from the dead? 🧟 These pages, often referred to as “zombie pages,” can be a result of custom post types (CPTs) that should not be displayed on a single view. Not only do these pages provide a poor user experience, but they can also negatively impact your website’s SEO. Today, we’ll explore what zombie pages are, how they can be created, and how to banish them from your website for good.
Imagine you’ve got a WordPress website that uses a custom post type (CPT) for testimonials. Each testimonial is added to the WP admin individually and displayed throughout various pages on your site. However, it was never intended for these testimonials to have their own indexable pages. As a result, they don’t have a specific template, making them visually unappealing and providing a bad experience for visitors who stumble upon them through a search. This situation is what we call “zombie pages.”
We all understand that a strong online presence is crucial to attracting and retaining customers. One of the main factors that contribute to your online visibility is your website’s SEO, or search engine optimization. A well-optimized site will rank higher in search engine results, making it easier for potential customers to find you.
However, zombie pages can have a detrimental effect on your site’s SEO performance. These undead pages can:
Search engines like Google use algorithms to assess the quality of a site’s content. When your site has a lot of low-quality pages, like zombie pages, it can lower your overall content score and hurt your rankings.
Search engines allocate a certain amount of time to crawl and index your website. Zombie pages can use up valuable crawl budget, preventing search engines from finding and indexing your high-quality content.
When visitors accidentally land on a zombie page, they are likely to have a negative experience and leave your site without engaging further. High bounce rates and low user engagement can signal to search engines that your site is not providing valuable content, further damaging your SEO.
To find these undead pages lurking on your site, you can review your sitemap or use Google Search Console. Both methods will reveal any indexable pages, including those pesky zombie pages. Be sure to go through each page and make note of any URLs that shouldn’t be there.
Disabling Single View and Creating Redirects
To put these zombie pages to rest, you’ll need to disable the single view for CPTs in WordPress. Here’s how:
Step 1: In your WordPress theme’s functions.php file, add the following code snippet:
add_action(‘template_redirect’, ‘remove_single_cpt_view’);
function remove_single_cpt_view() {
if (is_singular(‘testimonial’)) {
global $wp_query;
$wp_query->set_404();
status_header(404);
get_template_part(404);
exit();
}
}
function remove_single_cpt_view() {
if (is_singular(‘testimonial’)) {
global $wp_query;
$wp_query->set_404();
status_header(404);
get_template_part(404);
exit();
}
}
Note: Remember to replace ‘testimonial’ with the slug of the CPT you want to disable.
Step 2: Save and upload the functions.php file to your server.
Step 3: Now that you’ve disabled the single view for your CPTs, you’ll want to create 301 redirects for those zombie pages to avoid any broken links. You can do this using the Redirection plugin in WordPress:
1. Install and activate the Redirection plugin.
2. Go to Tools > Redirection in your WordPress dashboard.
3. Click the “Add New” button to create a new redirect.
4. In the “Source URL” field, enter the URL of the zombie page.
5. In the “Target URL” field, enter the URL where you want visitors to be redirected.
6. Set the “HTTP code” to “301 – Moved Permanently.”
7. Click “Add Redirect” to save your changes.
8. Repeat this process for each zombie page you’ve identified.
Zombie pages can harm your website’s user experience and SEO, but with a little know-how, you can banish them for good. By disabling the single view for CPTs in WordPress and creating 301 redirects using the Redirection plugin, you’ll ensure that your site remains free of unwanted, undead content. So go on and make big things happen online by keeping your website tidy and zombie-free! 🚀
We’re Reaction Digital, a remote website and branding agency based in Alberta, Canada. We understand that a robust online presence […]
The Canadian Government has released a technology grant called the Canada Digital Adoption Program designed to help small to medium-sized […]
Looking for some insight? Enter your name and email address below to receive a copy of our guide on the […]
Google Tag Manager was first introduced in 2012 and still, to this day, is the most powerful analytics tag management […]
It has been said it can take 10,000 hours to become an expert in a craft. Unless you work for […]
As a digital agency that’s been building websites since 2008, helping our clients grow their business by getting found on […]
Not your typical email newsletter with the same trending headlines. Our Digital Brief is a hand-selected shortlist of some of the best content online that will help you start making big things happen.