Title: get_custom_logo
Published: April 12, 2016
Last modified: May 20, 2026

---

# apply_filters( ‘get_custom_logo’, string $html, int $blog_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#wp--skip-link--target)

Filters the custom logo output.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#parameters)󠁿

 `$html`string

Custom logo HTML output.

`$blog_id`int

ID of the blog to get the custom logo for.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'get_custom_logo', $html, $blog_id );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/general-template.php#L1156)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/general-template.php#L1156-L1156)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#related)󠁿

| Used by | Description | 
| [get_custom_logo()](https://developer.wordpress.org/reference/functions/get_custom_logo/)`wp-includes/general-template.php` |

Returns a custom logo, linked to home unless the theme supports removing the link on the home page.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Added the `$blog_id` parameter. | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/get_custom_logo/?output_format=md#comment-content-1695)
 2.   [Bican Marian Valeriu](https://profiles.wordpress.org/vbmv/)  [  10 years ago  ](https://developer.wordpress.org/reference/hooks/get_custom_logo/#comment-1695)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_custom_logo%2F%23comment-1695)
    Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_custom_logo%2F%23comment-1695)
 4. If you test your site with Google’s Structured data testing tool you will get an
    error about itemprop “logo” not being recognized by google as a WP Header element.
    
    Here is how you remove itemprop
 5.     ```php
        add_filter( 'get_custom_logo', 'wecodeart_com' );
        // Filter the output of logo to fix Googles Error about itemprop logo
        function wecodeart_com() {
        	$custom_logo_id = get_theme_mod( 'custom_logo' );
        	$html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
                    esc_url( home_url( '/' ) ),
                    wp_get_attachment_image( $custom_logo_id, 'full', false, array(
                        'class'    => 'custom-logo',
                    ) )
                );
        	return $html;	
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_custom_logo%2F%3Freplytocom%3D1695%23feedback-editor-1695)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_custom_logo%2F)
before being able to contribute a note or feedback.