-
AuthorPosts
-
March 21, 2019 at 12:01 pm #1081346
Hi,
Google doesn’t index my site because the header is marked with noindex. <meta name=”robots” content=”noindex,follow”/>
In the header.php file there is a line of code: if (function_exists(‘avia_set_follow’)) { echo avia_set_follow(); }
If I remove that line the noindex in the header dissapear and Google will be able to index the site. This need to be doen every thime the theme get’s updated.
Is there any way to change so the header always is set to <meta name=”robots” content=”index,follow”/>Removing or excluding the following line will remove the meta tag for index: <meta name=”robots” content=”noindex, follow” />
header.php line 58
<?php
/*
* outputs a rel=follow or nofollow tag to circumvent Google duplicate content for archives
* located in framework/php/function-set-avia-frontend.php
*/
if (function_exists(‘avia_set_follow’)) { echo avia_set_follow(); }
?>Or edit
Enfold: function-set-avia-frontend.php (framework/php/function-set-avia-frontend.php)
//Meta was changed from $meta = ‘<meta name=”robots” content=”noindex, follow” />’ . “\n”; to content=index, follow
Line 403But I really need a permanent solution here and not having to edit the Enfold code for every update.
March 24, 2019 at 6:28 pm #1082290Hey DNbygg,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( do be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.Best regards,
BasilisMarch 24, 2019 at 7:10 pm #1082331Ensure that in the Enfold-Options directly on the first option-page your setting of the “Custom Error 404 Page” does not contain your Homepage.
Set it to “No custom 404 page selected” or create a seperate 404-page and select that one.Does that help?
March 25, 2019 at 10:06 am #1082596This reply has been marked as private.March 29, 2019 at 1:49 am #1084365Hi,
Thanks for the update.
That function should allow bots as long as the following conditions are met: it is a post, a page, the home page or is not on a paginated page. That is the existing logic in the function.
if ((is_single() || is_page() || is_home() ) && ( !is_paged() )) { $meta = '<meta name="robots" content="index, follow" />' . "\n"; }
Please enable the function back and try to deactivate the plugins temporarily.
Best regards,
IsmaelMarch 29, 2019 at 2:11 pm #1084585I took a loog agiain and view the page code. It looks like this only is an issue for the WooCommerce pages.
I do not get this issue on the home and contact page but going to shop page and choosing a brand so I get the product category it will say follow, noindexMarch 31, 2019 at 10:55 pm #1085197Hi,
Thanks for the update.
Try to use this filter in the functions.php file:
if(!function_exists('avia_woocommerce_set_follow')) { function avia_woocommerce_set_follow($meta) { if( is_product_category() || is_shop() ) { $meta = '<meta name="robots" content="index, follow" />' . "\n"; } return $meta; } add_filter('avf_set_follow','avia_woocommerce_set_follow', 10, 1); }
The snippet should set the product category and shop pages robots meta to index, follow.
Best regards,
Ismael- This reply was modified 5 years, 8 months ago by Ismael.
April 1, 2019 at 9:35 am #1085379Hi,
Thanks for that but I got an error:
syntax error, unexpected ‘https’ (T_STRING), expecting ‘,’ or ‘)’The code was restored to the previous version because of an error.
April 1, 2019 at 10:40 am #1085411syntax error, unexpected ‘{‘
PHP Syntax Check: Parse error: syntax error, unexpected ‘{‘ in your code on line 2if(!function_exists(#039;avia_woocommerce_avia_set_follow'))
{
function avia_wpseo_deactivate_avia_set_follow($meta)
{
if( is_product_category() || is_shop() ) {
$meta = '<meta name="robots" content="index, follow" />' . "\n";
}
return $meta;
}add_filter('avf_set_follow','avia_woocommerce_avia_set_follow', 10, 1);
}April 1, 2019 at 10:41 am #1085412I’m using PHP 7.2 on the site.
April 2, 2019 at 12:21 am #1085755Hi!
Sorry about that. The forum automatically converts the “woocommerce” string to links. We also corrected the function name. Please try it again.
Best regards,
IsmaelApril 2, 2019 at 8:48 am #1085935That worked like magic, thanks
Is it possible to add product tag as well?April 2, 2019 at 10:02 am #1085989Hi again,
Made it work:
{
if( is_product_category() || is_shop() || is_product_tag())
{Thanks so much for the help
April 3, 2019 at 5:07 am #1086342Hi DNbygg,
Great, I’m glad you got it working and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardApril 15, 2019 at 12:34 pm #1090941Hi, everything works perfectly. Please close this ticket
April 16, 2019 at 12:34 am #1091141Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon -
AuthorPosts
- The topic ‘Header on site marked with "noindex"’ is closed to new replies.