How should I remove no-follow tag from the wordpress website?
How should I remove no-follow tag from the wordpress website?
How should I remove no-follow tag from the wordpress website?
Writing a robots.txt is an easy process. Follow these simple steps: Open Notepad, Microsoft Word or any text editor and save the file as ‘robots,’ all lowercase, making sure to choose .txt as the file type extension (in Word, choose ‘Plain Text’ ). Next, add the following two lines of text to your file: User-agent: … Read more
Why you are changing the code for these thing which are able done via dashboard.? WordPress comes with a built-in feature that allows you to instruct search engines not to index your site. All you need to do is visit Settings » Reading and check the box next to Search Engine Visibility option. When this … Read more
After the question’s update, I think that you need to set the canonical URL: add_action( ‘wp_head’, ‘cyb_search_results_canonical_URL’ ); function cyb_search_results_canonical_URL() { if( is_search() ) { $link = get_search_link(); echo ‘<link rel=”canonical” href=”‘ . esc_url( $link ) . ‘”>’; } } And your problem with duplicated content is fixed.
The function you want is get_userdata(). Since you need to do this outside the loop, the process is a little less straight-forward. The first thing you need to do is set up a variable called $curauth which is an object that you create by accessing the database by using the $_GET[] superglobal. $curauth = ( … Read more
Being excluded-cat and excluded-cat-1 the categories you want to exclude from indexing: add_action(‘wp_head’,’AS_exclude_category_from_indexing’); function AS_exclude_category_from_indexing(){ $html=””; if(has_category(‘excluded-cat’) || has_category(‘excluded-cat-1’)){ $html= “<meta name=\”robots\” content=\”noindex,follow\”>”.PHP_EOL; } echo $html; }
From codex: is_author() is a conditional tag which determines whether the query is for an existing author archive page. so it does not work for your scope. Best solution, instead of using the template file header.php is to write a function in functions.php hooking the proper action wp_head: add_action(‘wp_head’,’AS_exclude_author_from_indexing’); function AS_exclude_author_from_indexing(){ $toIndex = array(111,112,113); $user_id … Read more
You can try the wp_head hook: add_action( ‘wp_head’, ‘check_for_enviso_group_ticket’ ); function check_for_enviso_group_ticket() { if ( is_product() && ( ‘enviso_group_ticket’ == get_the_terms( get_the_ID(), ‘product_type’ )[0]->slug ) ) { echo ‘<meta name=”robots” content=”noindex,nofollow”/>’, PHP_EOL; } } or to not break your site in case the WooCommerce is disabled and the is_product() function isn’t defined: add_action( ‘wp_head’, ‘check_for_enviso_group_ticket’ … Read more
Stupid me… I have a nginx directive that set X-Robots-Tag to none for every page. I thought it was some kind of null value for the header… Now that I took some time to RTFM, I learned that none means both noindex and nofollow… So it wouldn’t let the SEO plugin do its job. Now … Read more
give an noindex in your robots.txt – Disallow: /wp-content/plugins/ and dont access the wp-content/plugins folder; also you can add an 301 redirect in your WP install via Plugin or with an extra in the htaccess