If you’re like most web developers, you have a staging site where you test and develop changes to your website before pushing them live. Staging sites are essential for ensuring that your live website doesn’t go down or break when you make changes. However, there is one potential pitfall with staging sites: if they’re not properly configured, they can be indexed by Google and other search engines.
This can be a problem for a few reasons. First, staging sites often contain incomplete or outdated content. Second, staging sites may be accessible to the public, even if you don’t intend them to be. This can lead to confusion and frustration for users who stumble upon your staging site and think it’s your live website.
Finally, if your staging site has inbound links, it can actually hurt your live website’s ranking in search engine results pages (SERPs). This is because Google sees the inbound links to your staging site as votes for that site, even though it’s not your live website.
If you find that your staging site has been indexed by Google, there are a few things you can do to remove inbound links and make it noindex:
- Add a noindex meta tag to your staging site’s pages. This will tell Google not to index the pages. To do this, add the following code to the
<head>section of your staging site’s HTML pages:
<meta name="robots" content="noindex">
- Disallow crawling of your staging site in your robots.txt file. This will tell all search engines not to crawl your staging site. To do this, add the following lines to your robots.txt file:
User-agent: * Disallow: /staging/
- Remove any inbound links to your staging site. If there are any websites or blogs that link to your staging site, contact the webmasters and ask them to remove the links.
- Use the Google Search Console URL Removal Tool to request the removal of specific URLs from Google’s index. This is a more proactive approach to remove already indexed content.
Once you have taken these steps, it may take some time for Google to deindex your staging site and remove the inbound links. However, be patient and eventually your staging site will disappear from SERPs.
How you can prevent your staging site from being indexed by Google in the first place:
- Use a password to protect your staging site. This will prevent unauthorized users from accessing your site.
- Host your staging site on a subdomain or subdirectory of your live website. Google is less likely to index staging sites that are located on subdomains or subdirectories.
- Use a staging site plugin or service. There are a number of plugins and services that can help you to configure and manage your staging site, including preventing it from being indexed by search engines.
By following these tips, you can ensure that your staging site remains hidden from Google and other search engines.