Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1056849

    Hi, I’m using SEMrush to audit my site and I have about 600 warnings because Enfold use “nofollow” in search item,

    SEMrush give me this information

    :::
    The rel=”nofollow” attribute is an element in an tag that tells crawlers not to follow the link (e.g., “Nofollow link example“).”Nofollow” links don’t pass any link juice to referred webpages. That’s why it is not recommended that you use nofollow attributes in internal links. You should let link juice flow freely throughout your website. Moreover, unintentional use of nofollow attributes may result in your webpage being ignored by search engine crawlers even if it contains a valuable content.
    :::

    There is some way to remove from functions-enfold.php:124 by a function?

    Thanks!

    #1057262

    Hey Gabri,

    You’ll need to use a child theme first: https://kriesi.at/documentation/enfold/child-theme/
    Then add this on the child theme’s functions.php:

    add_filter( 'wp_nav_menu_items', 'avia_append_search_nav', 9997, 2 );
    add_filter( 'avf_fallback_menu_items', 'avia_append_search_nav', 9997, 2 );
    
    function avia_append_search_nav ( $items, $args )
    {	
        if(avia_get_option('header_searchicon','header_searchicon') != "header_searchicon") return $items;
        if(avia_get_option('header_position',  'header_top') != "header_top") return $items;
    
        if ((is_object($args) && $args->theme_location == 'avia') || (is_string($args) && $args = "fallback_menu"))
        {
            global $avia_config;
            ob_start();
            get_search_form();
            $form =  htmlspecialchars(ob_get_clean()) ;
    
            $items .= '<li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown menu-item-avia-special">
                            <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'><span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span></a>
                        </li>';
        }
        return $items;
    }

    Best regards,
    Nikko

    #1057354

    Hi Nikko, thanks for your quickly response, your code works fine,

    Thanks!

    #1057357

    Hi Gabri,

    Glad that we are able to help :)
    Thanks for using Enfold and have a great day!

    Best regards,
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Remove "nofollow" from search item of main menu’ is closed to new replies.