Multiple H1 Tags Issue - FIXED! ✅

The Problem

You reported that some pages on ITBlogPros.com have multiple <h1> tags, which is bad for SEO. Here's what was happening:

Why This Occurred

  1. Layout Template (_includes/layout.njk) automatically wraps your page title in an <h1> tag:

    <h1 itemprop="headline"></h1>
    
  2. Old Posts Some older posts used # (H1) headings in their markdown content:

    # My Heading  ← Creates another H1!
    
  3. Result: Pages had multiple H1 tags, which:

The Solution ✨

Step 1: Find Posts with H1 Issues

Run this command from the C:\dev\itblogpros directory:

node find-h1-issues.js

This will scan all your posts and report which ones have H1 tags in their content.

Step 2: Automatically Fix All Posts

Run this command to automatically convert all # (H1) to ## (H2):

node fix-h1-issues.js

This script will:

Step 3: Rebuild Your Site

After fixing the posts, rebuild your site:

npx @11ty/eleventy --serve

Visit http://localhost:8080 and check a few pages to verify there's only one H1 per page.

Correct Heading Structure Going Forward

✅ CORRECT Format

---
layout: layout.njk
title: "Your Article Title"  ← This becomes the H1
description: "Your description here"
date: 2025-10-09
tags: ["post", "category"]
---

Content introduction paragraph...

## Main Section  ← Start with H2

Your content here...

### Subsection  ← Use H3 for subsections

More content...

#### Detail Level  ← Use H4 for deeper levels

Even more detail...

## Another Main Section  ← Back to H2

Continue your article...

❌ INCORRECT Format

---
title: "Your Article Title"  ← Becomes H1
---

# My Heading  ← Creates SECOND H1! ⚠️

This is wrong! Don't do this!

How to Check Your Pages

Method 1: Browser DevTools

  1. Open your page in Chrome/Firefox
  2. Press F12 to open DevTools
  3. Press Ctrl+F and search for <h1
  4. You should see only ONE result per page

Method 2: View Source

  1. Right-click on the page → "View Page Source"
  2. Press Ctrl+F and search for <h1>
  3. Should find only one H1 tag with your article title

Method 3: SEO Tools

Use tools like:

Documentation Updated

I've updated these files to prevent this issue in the future:

  1. ARTICLE-TEMPLATE.md - Added warning at the top
  2. QUICK-REFERENCE.md - Added to content writing section
  3. PROJECT-README.md - Added comprehensive "Heading Structure for SEO" section

Why One H1 Matters for SEO

Search Engine Impact

  1. Clarity: Search engines use H1 to understand page topic
  2. Hierarchy: Multiple H1s create confusion about importance
  3. Rankings: Can negatively impact search rankings
  4. Featured Snippets: Proper structure helps win featured snippets

Best Practices

Verification Checklist

After running the fix scripts, verify:

Future Prevention

For New Articles

  1. Use the updated ARTICLE-TEMPLATE.md
  2. Start all content headings with ## (H2)
  3. Never use # (H1) in markdown content
  4. Check QUICK-REFERENCE.md when creating posts

For Edited Articles

  1. Follow same heading rules as new articles
  2. Convert any # to ## if found
  3. Preview locally before publishing

Technical Details

What the Scripts Do

find-h1-issues.js:

fix-h1-issues.js:

Layout Template Logic

In _includes/layout.njk:


  <article itemscope itemtype="https://schema.org/BlogPosting">
    <header>
      <h1 itemprop="headline"></h1>  ← Only H1 on page
    </header>
    <section class="post-content" itemprop="articleBody">
        ← Should only contain H2 and below
    </section>
  </article>

Questions?

If you have any questions about:

Just ask! I'm here to help ensure your site has perfect SEO structure.


Status:FIXED

Next Step: Run node find-h1-issues.js to see which posts need fixing!