How to Add H1 Tag to WordPress Homepage: A Complete Guide

There are several WordPress themes that, when you set your homepage to display the latest posts instead of a static page, may not include an H1 tag on your homepage, category page, or tags page—effectively leaving all archive category pages without this important element. If a page is missing an H1 tag, search engines, particularly Google and Bing, will flag this issue, which could negatively impact your page’s ranking.

In this post, I will outline the steps to add an H1 tag to your homepage, category page, and tags page. The changes are straightforward; however, remember that you will need to repeat these updates whenever you update your theme. For a permanent solution, consider creating a child theme to include your code snippets. While I will be demonstrating these steps using the Blocksy theme, many other themes follow similar naming conventions, so you can apply these changes to them as well.

Here are the steps:
  • Given that the font size of the H1 tag is usually quite large, you can adjust it to a smaller size by defining a CSS class for the H1 tag. Log into WordPress as an admin and navigate to the admin dashboard. From the dashboard, go to Appearance -> Customize -> Additional CSS (as shown in the figure below).
Customize wordpress theme
  • In the “Additional CSS” textbox, enter the following CSS and click the Publish button to save your changes. Here, I have set the font size to 12px; change it if you wish.
.title-h1-heading-manual {
    font-size: 12px;
    text-align: center;
    display: block;
    margin: 0 auto;
}
  • Next, go to Appearance -> Theme File Editor and locate the ‘archive.php‘ file. In the Blocksy theme, this file is found inside the ‘template-parts’ folder. Search for the following lines of codes (it should be around line 45-46):
<div class="<?php echo $container_class ?>" <?php echo wp_kses_post(blocksy_sidebar_position_attr()); ?> <?php echo blocksy_get_v_spacing() ?>>
	<section <?php echo $section_class ?>>
  • Before these codes, add the following code snippet:

If you want description as part of the H1 tag:

<h1 class="title-h1-heading-manual"><?php echo get_bloginfo('description'); ?></h1>

If you want title as part of the H1 tag:

<h1 class="title-h1-heading-manual"><?php echo get_bloginfo('name'); ?></h1>

If you want some manual text as part of the H1 tag:

<h1 class="title-h1-heading-manual">YOUR_TEXT</h1>
  • Save the file, and now your homepage, category page, and tags page will display the text you have specified for the H1 tag.

If you encounter any issues with these steps, please let me know!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.