Ecommerce Shopify WordPress Discussion

How to stop search engines from indexing the hash links on WP page properly

I noticed all of the hash-links from the table of content on my blog have been indexed on google and I don't want that.. I don't want links like this to be indexed on google: Because it's the same page as How can I achieve that? I tried googling the answer, it seemed like a common problem, but no help..
To keep search engines from indexing hash links (those with fragment identifiers) on your WordPress page, you have two methods: using the "robots meta tag" or the "robots.txt" file. Here's a step-by-step guide for each: Method 1: Using the robots meta tag Edit the Header.php file: Log in to your WordPress dashboard. Go to Appearance -> Theme Editor. Find and click on the header.php file on the right side. Add the meta tag: Inside the <head> section, paste the following meta tag: html <meta name="robots" content="noindex, nofollow"> This tag signals search engines not to index the page and to ignore the links. Save changes: Save the updated header.php file. Method 2: Using the robots.txt file Edit the robots.txt file: Connect to your WordPress site via FTP or your hosting provider's file manager. Look for the robots.txt file in your WordPress root directory. Add Disallow rule: Insert these lines in your robots.txt file: makefile User-agent: * Disallow: /*# This blocks search engines from crawling URLs containing a hash symbol (#). Save changes: Save the modified robots.txt file. Important Considerations: Exercise caution: Blocking search engines may impact your SEO, so understand the consequences. Check robots.txt: Ensure it's correctly formatted and doesn't accidentally block crucial pages. Robots meta tag scope: Adding the tag in header.php affects all pages; for specific pages, consider using a plugin. Test the changes: Confirm search engines behave as expected using tools like Google Search Console.

January 20, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.