Check If search query contains something?

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.

Noindex subscriber author page

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

How to noindex automatically all post of a specific category? [closed]

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; }

Noindex Posts From Certain Authors In WordPress

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

Force meta data on specific product type

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

Noindex,Nofollow in theme’s header.php?

I think not. Because it’s not indexing the result page: See: <?php if (is_search()) { ?> if is Search doesn’t index or follow the page (for example to not show duplicated content). But you can remove the code if you feel you are losing views. I was reading an article about this. Even if WordPress … Read more

Not able to remove NOODP tag from wordpress site [closed]

Your Yoast SEO plugin version is outdated. If you update your plugin to the latest version, at this moment 17.2.1, your issue will be resolved. There was an issue resolved in version 4.6 that affects your version, see this github issue for details: https://github.com/Yoast/wordpress-seo/issues/6843

Allow Google crawler to crawl specific Author pages

I would normally ask a couple clarifying questions but I don’t have the reputation to do it so let’s see if I can give you a workable solution. I don’t know what you consider to be high quality but if it is certain fields being complete, you could do an if/else statement around those fields … Read more