There are many situations where you might want to prevent search engines like Google from showing your website in search results-for example, when you are still developing your mybox-hosted site, creating a private staging area, or setting up a landing page for a specific group of people.
Table of Contents
Method 1: The Built-in WordPress Setting (Easiest)
WordPress has a native “one-click” option that requests search engines not to index the site.
- Log in to your WordPress dashboard.
- Navigate to Settings > Reading.
- Scroll to the bottom and find the “Search Engine Visibility” section.
- Check the box: “Discourage search engines from indexing this site”.
- Click Save Changes.
Note: This adds a noindex tag to your site’s header. While most reputable search engines honor this request, it is technically a “request” rather than a hard lock.
Method 2: Using the robots.txt File
You can manually tell search engine “crawlers” which parts of your mybox-hosted site are off-limits.
- Access your files via FTP.
- In the root directory (usually
public_html), look for a file namedrobots.txt. If it doesn’t exist, create it. - Add the following lines to block the entire site:Plaintext
User-agent: * Disallow: / - If you only want to block a specific folder (like
/private/), use:PlaintextUser-agent: * Disallow: /private/
Method 3: Password Protection (Most Secure)
If you need a 100% guarantee that no one (including bots and unauthorized users) can see your content, password protection is the best approach.
Via the mybox Panel:
- Log in to your mybox panel.
- Navigate to the Websites or Security section.
- Look for “Password Protected Directories”.
- Select your site’s directory and create a username and password. This prevents any crawler from accessing the code of your site because they cannot bypass the login prompt.
Via Plugin:
Alternatively, you can use a plugin like “Password Protected” to lock the entire front end of your site while allowing you to stay logged in as an admin.
Method 4: Using an SEO Plugin (Granular Control)
If you use a plugin like Yoast SEO or Rank Math, you can block specific pages or posts instead of the whole site.
- Open the editor for a specific post or page.
- Scroll down to the SEO plugin settings box.
- Under the “Advanced” tab, find the “Robot meta” settings.
- Select “No” for the option “Allow search engines to show this Page in search results?”.
Important: What to do when you go Live
The most common mistake developers make is forgetting to turn these settings off. When you are ready for the world to see your mybox-hosted site:
- Uncheck the box in Settings > Reading.
- Remove the
Disallow: /line from yourrobots.txt. - Disable directory password protection in your mybox panel.
Summary
Blocking your site from indexing is a mechanical necessity during the construction phase of your project. Whether you use the simple WordPress toggle for a quick fix or the mybox panel for a secure password lock, ensuring your site stays hidden until it’s perfect is a key part of professional site management.