• Hi,
    I have a problem with h1 home page. I hide site title in my site https://www.studiofazzari.it because the same words (Studio Fazzari) are impressed on my logo. Now Seo test return me an error: “The tag <h1> is missing on your page.” How can I do?

Viewing 10 replies - 1 through 10 (of 10 total)
  • If I have understood correctly the work around could be to put back the <h1></h1> tag and make it hidden on page load using JavaScript.

    Do not hide using display:none or same background color to make it invisible to human eye. Google ignores both.

    But if you use the JavaScript way Google will still read it.

    Hope this helps.

    Thread Starter ciccione82

    (@ciccione82)

    How can I do with js? I have to make h1 invisible to human eye but not to google. Please help me

    First give some ID to the <h1> tag you want to hide, for example <h1 id="hide_it">Your content here...</h1>.

    Now open your footer.php file add this before ending </body> tag.

    <script type="text/javascript">
      $(document).ready(function(){
        $("#hide_it").hide();
      });
    </script>

    I am not sure about how the layout is structured for this particular theme. But the above should work.

    Let me know how this goes.

    PS: The reason why hiding with JavaScript still leaves it visible to SEO is the element would get hidden in generated output. If you simply use View Source of your page you will still be able to see the element present there. But if you see Generated Source of the same page then the markup of the same h1 will look like this:

    <h1 id=”hide_this” style=”display:none;”>Your content</h1>. Good thing with Google is it only deals with normal Source , not generated source.

    Thread Starter ciccione82

    (@ciccione82)

    Where I have to paste this? <h1 id="hide_it">Your content here...</h1>

    You said you removed the h1. So just put it back where it was with the site title. Only thing is add the id "hide_it" to this h1 for referencing in the JavaScript.

    Thread Starter ciccione82

    (@ciccione82)

    Ok, but I added h1 by WordPress consolle “site title”. I’m not an expert. In what file can I find h1 to add ID?

    That h1 should ideally be residing inside your theme’s header.php file.

    Thread Starter ciccione82

    (@ciccione82)

    This inìs my header.php:

    <?php
    /**
     * The header for the OnePress theme.
     *
     * This is the template that displays all of the <head> section and everything up until <div id="content">
     *
     * @link https://developer.www.ads-software.com/themes/basics/template-files/#template-partials
     *
     * @package OnePress
     */
    
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="profile" href="https://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    <?php do_action( 'onepress_before_site_start' ); ?>
    <div id="page" class="hfeed site">
    	<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'onepress' ); ?></a>
        <?php
        /**
         * Hooked: onepress_site_header
         *
         * @see onepress_site_header
         */
        do_action( 'onepress_site_start' );
        ?>

    ??

    Thread Starter ciccione82

    (@ciccione82)

    I don’t know how can I do. ??

    • This reply was modified 7 years, 7 months ago by ciccione82.

    hey @ciccione82

    I recommend you install this plugin to add custom js/css :
    https://www.ads-software.com/plugins/custom-css-js/

    then add in custom js :

    jQuery( function($) {
    $('.site-title').hide();
    });

    Let me know how it goes!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘H1 problem. Seo test do not recognize it’ is closed to new replies.