Home>Support>Seo bug in logo

Seo bug in logo

By Bertre, 9 years ago. Last reply by Andrew Misplon, 9 years ago.

Hi. I bought 4 Vantage templates and on all my sites when I use it I can see in Keywords on Webmaster Tools something like this: “sitename logo”, where sitename = real sitename.

My question is how remove the word “logo”? I suppose that it depends on title for logo in menu, but I can’t find the right answer.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    Hi Bertre

    Apologies for the delay. We’ve had some problems verifying orders numbers on the forum, hopefully you didn’t run into that problem.

    Thanks for your support. To resolve this issue you’d need to use a child theme, we have a starter one here:
    https://github.com/siteorigin/vantage-child

    For more on child themes please see:
    https://codex.wordpress.org/Child_Themes

    Within the child theme you can add the following to functions.php:

    if(!function_exists('vantage_display_logo')):
    /**
     * Display the logo 
     */
    function vantage_display_logo(){
    	$logo = siteorigin_setting( 'logo_image' );
    	$logo = apply_filters('vantage_logo_image_id', $logo);
    
    	if( empty($logo) ) {
    		if ( function_exists( 'jetpack_the_site_logo' ) && jetpack_has_site_logo() ) {
    			// We'll let Jetpack handle things
    			jetpack_the_site_logo();
    			return;
    		}
    
    		// Just display the site title
    		$logo_html = '<h1 class="site-title">'.get_bloginfo( 'name' ).'</h1>';
    		$logo_html = apply_filters('vantage_logo_text', $logo_html);
    	}
    	else {
    		// load the logo image
    		if(is_array($logo)) {
    			list ($src, $height, $width) = $logo;
    		}
    		else {
    			$image = wp_get_attachment_image_src($logo, 'full');
    			$src = $image[0];
    			$height = $image[2];
    			$width = $image[1];
    		}
    
    		// Add all the logo attributes
    		$logo_attributes = apply_filters('vantage_logo_image_attributes', array(
    			'src' => $src,
    			'class' => siteorigin_setting('logo_in_menu_constrain') ? 'logo-height-constrain' : 'logo-no-height-constrain',
    			'width' => round($width),
    			'height' => round($height),
    			'alt' => sprintf( __('%s', 'vantage'), get_bloginfo('name') ),
    		) );
    
    		if($logo_attributes['width'] > vantage_get_site_width()) {
    			// Don't let the width be more than the site width.
    			$width = vantage_get_site_width();
    			$logo_attributes['height'] = round($logo_attributes['height'] / ($logo_attributes['width'] / $width));
    			$logo_attributes['width'] = $width;
    		}
    
    		$logo_attributes_str = array();
    		if( !empty( $logo_attributes ) ) {
    			foreach($logo_attributes as $name => $val) {
    				if( empty($val) ) continue;
    				$logo_attributes_str[] = $name.'="'.esc_attr($val).'" ';
    			}
    		}
    
    		$logo_html = apply_filters('vantage_logo_image', '<img '.implode( ' ', $logo_attributes_str ).' />');
    	}
    
    	// Echo the image
    	echo apply_filters('vantage_logo_html', $logo_html);
    }
    endif;
    

    I’ve removed the “Logo” string from the function.

    Let us know if you need a hand implementing this.

  2. 9 years, 5 months ago Bertre

    Big thanks for this reply. I do this what You wrote, so I believe that this problem will be solved.
    After few weeks I will write to You here and tell You about the effects.

    Have a nice day!

  3. 9 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    For sure, glad we could help. You should be able to inspect the page source now and see if the alt tag has changed. Let us know if you need a hand with that.

  4. 9 years, 5 months ago Bertre

    Yes, You are right, alt tag has changed, so probably problem is solved :)
    Thanks!

  5. 9 years, 5 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad to hear that did the trick. All the best :)

  6. 9 years, 2 months ago Bertre

    This problem isn’t solved and I know why! (But still don’t know how to change it).

    Easy test:
    1. Put a logo on Your website and use it by Theme Settings->Logo
    2. Delete the logo file from server (not remove logo from Theme Settings)
    3. See what happen in menu:
    We can see there a text: “Site name LOGO”.

    So here is a problem why Google Webmasters see this word LOGO. How can I remove it?

  7. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Hi :)

    Here is the original source code from our demo:

    <a href="http://demo.siteorigin.com/vantage/" title="Vantage Demo" rel="home" class="logo">
    	<img src="http://demo.siteorigin.com/vantage/files/2015/04/logo.png" width="181" height="40" alt="Vantage Demo Logo" data-retina-image="http://demo.siteorigin.com/vantage/files/2015/04/logo.png" scale="0">
    </a>
    

    The string “logo” is mentioned in the alt tag. The job of the alt is to describe what the image. If you’d like to remove the word “logo” it’s only mentioned once in the following function: vantage_display_logo. Here is the line in question:

    'alt' => sprintf( __('%s Logo', 'vantage'), get_bloginfo('name') ),

    Are you running the child theme solution to change the alt tag?

  8. 9 years, 2 months ago Bertre

    Yes, I use child theme :) I know that it is for describe image, but Google Webmasters count this as “phrase + logo” which isn’t so good for SEO…

    'alt' => sprintf( __('%s Logo', 'vantage'), get_bloginfo('name') ),

    Here is probably the solution – we must delete “Logo” word.

    But can You tell me where this line is in template?

  9. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the explanation.

    My first reply details how to add the relevant function to your child theme functions.php file and edit it. Let me try explain again:

    1. Add the following to the functions.php file in your child theme:

    if(!function_exists('vantage_display_logo')):
    /**
     * Display the logo 
     */
    function vantage_display_logo(){
    	$logo = siteorigin_setting( 'logo_image' );
    	$logo = apply_filters('vantage_logo_image_id', $logo);
    
    	if( empty($logo) ) {
    		if ( function_exists( 'jetpack_the_site_logo' ) && jetpack_has_site_logo() ) {
    			// We'll let Jetpack handle things
    			jetpack_the_site_logo();
    			return;
    		}
    
    		// Just display the site title
    		$logo_html = '<h1 class="site-title">'.get_bloginfo( 'name' ).'</h1>';
    		$logo_html = apply_filters('vantage_logo_text', $logo_html);
    	}
    	else {
    		// load the logo image
    		if(is_array($logo)) {
    			list ($src, $height, $width) = $logo;
    		}
    		else {
    			$image = wp_get_attachment_image_src($logo, 'full');
    			$src = $image[0];
    			$height = $image[2];
    			$width = $image[1];
    		}
    
    		// Add all the logo attributes
    		$logo_attributes = apply_filters('vantage_logo_image_attributes', array(
    			'src' => $src,
    			'class' => siteorigin_setting('logo_in_menu_constrain') ? 'logo-height-constrain' : 'logo-no-height-constrain',
    			'width' => round($width),
    			'height' => round($height),
    			'alt' => sprintf( __('%s', 'vantage'), get_bloginfo('name') ),
    		) );
    
    		if($logo_attributes['width'] > vantage_get_site_width()) {
    			// Don't let the width be more than the site width.
    			$width = vantage_get_site_width();
    			$logo_attributes['height'] = round($logo_attributes['height'] / ($logo_attributes['width'] / $width));
    			$logo_attributes['width'] = $width;
    		}
    
    		$logo_attributes_str = array();
    		if( !empty( $logo_attributes ) ) {
    			foreach($logo_attributes as $name => $val) {
    				if( empty($val) ) continue;
    				$logo_attributes_str[] = $name.'="'.esc_attr($val).'" ';
    			}
    		}
    
    		$logo_html = apply_filters('vantage_logo_image', '<img '.implode( ' ', $logo_attributes_str ).' />');
    	}
    
    	// Echo the image
    	echo apply_filters('vantage_logo_html', $logo_html);
    }
    endif;
    

    2. Locate the following line in the function once added to functions.php:

    'alt' => sprintf( __('%s Logo', 'vantage'), get_bloginfo('name') ),
    

    Edit as required.

    Hope that helps.

  10. 9 years, 2 months ago Bertre

    Probably I am doing something wrong, because it still show “Logo” word. What is more – when I delete all “alt” tags it still show “site name + logo”.

    I have better idea – tell me where is te source of this “logo” word then I will change it manually (no by child theme, not by functions.php – I will edit this wordpress file and delete “logo” word).

  11. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    The line we're changing originates from /inc/template-tags.php in the vantage theme folder.

    I'll be back at my computer in a bit and will take another look then.

  12. 9 years, 2 months ago Bertre

    Bingo! I deleted “Logo” word in this file and now all is OK :)

    Big thanks for a fantastic support!

  13. 9 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad to hear you progress. If you’d like me to take a look at your child theme, please, email it to me at: Private Snippet

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More