Tagged: ,

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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 403

    But I really need a permanent solution here and not having to edit the Enfold code for every update.

    #1082290

    Hey DNbygg,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    1. Install and activate ” Temporary Login Without Password “.
    2. Go to ” Users > Temporary Logins ” on the left-side menu.
    3. Click ” Create New “.
    4. 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 ).
    5. Click ” Submit “.
    6. 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,
    Basilis

    #1082331

    Ensure 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?

    #1082596
    This reply has been marked as private.
    #1084365

    Hi,

    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,
    Ismael

    #1084585

    I 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, noindex

    #1085197

    Hi,

    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, 7 months ago by Ismael.
    #1085379

    Hi,

    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.

    #1085411

    syntax error, unexpected ‘{‘
    PHP Syntax Check: Parse error: syntax error, unexpected ‘{‘ in your code on line 2

    if(!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);
    }

    #1085412

    I’m using PHP 7.2 on the site.

    #1085755

    Hi!

    Sorry about that. The forum automatically converts the “woocommerce” string to links. We also corrected the function name. Please try it again.

    Best regards,
    Ismael

    #1085935

    That worked like magic, thanks
    Is it possible to add product tag as well?

    #1085989

    Hi again,
    Made it work:
    {
    if( is_product_category() || is_shop() || is_product_tag())
    {

    Thanks so much for the help

    #1086342

    Hi 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,
    Rikard

    #1090941

    Hi, everything works perfectly. Please close this ticket

    #1091141

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Header on site marked with "noindex"’ is closed to new replies.