✅ 1. Use “noindex” via an SEO Plugin (Best for Pages/Posts)
If you’re using a plugin like Yoast SEO or Rank Math, it’s easy:
🧩 With Yoast SEO:
-
Edit the post or page.
-
Scroll down to the Yoast SEO box.
-
Click the “Advanced” tab (gear icon).
-
Set “Allow search engines to show this Post in search results?” to “No”.
-
Update the page.
🧩 With Rank Math:
-
Edit the page or post.
-
Scroll to the Rank Math SEO box.
-
Click the Advanced tab.
-
Set “Robots Meta” to “noindex”.
-
Update the page.
🟢 This method keeps the page visible to users, but tells search engines not to index it.
✅ 2. Disallow URLs in robots.txt (Best for folders or custom paths)
If you want to block entire sections, edit your robots.txt file:
txtCopyEditUser-agent: *Disallow: /private-page/Disallow: /wp-content/uploads/drafts/
🔒 Be careful: this stops Google from crawling the page, but not necessarily from indexing it if other sites link to it. For true blocking, combine this with a noindex tag.
✅ 3. Set to “Private” or “Password Protected” (for Members-Only Pages)
In the WordPress editor:
-
In the Visibility section (under “Publish”), choose:
-
Private: Only admins/editors can see it
-
Password Protected: Only users with the password can access
-
🔐 Google won’t index private or password-protected content.
✅ 4. Use Custom Code (If No SEO Plugin)
Add this to the <head> section of your theme or via a plugin like “Insert Headers and Footers”:
htmlCopyEdit<meta name=”robots” content=”noindex, nofollow”>
⚠️ Only do this if you know how to edit your theme files safely.
✅ 5. Discourage Search Engines Site-Wide (Not Recommended for Live Sites)
Go to:Settings → Reading → Search Engine Visibility
✔️ Check the box: “Discourage search engines from indexing this site”
⚠️ Only use this if your site is under development. Google can still index parts of the site if other sites link to it.