Preventing multiple H1 elements (Split theme)


(allan kelly) #1

I’m using Split theme with RW 7.3.2 and I want to prevent my pages having multiple H1 elements.

As I understand SEO the H1 tag is important but Google expects to see one, and only one, on each page.

As each of my pages is different I want to set the H1 element - most of my pages are styled text or Markdown but either way I want page by page control.

But, looking at the HTML generated I find that RW or Split puts the title (Settings/General) as H1. Which I don’t want because that is for the whole site.

So I deleted my text in Settings/General/Title. But this just results in

in the html. Still two H1 tages.

Next I unclicked the checbox next to Title but the same thing.

In fact the whole intro section is now empty:

   <section id="intro">
            <div id="intro-background"></div>
            <div id="intro-tagline">
                    <h1></h1> 
            </div> 
    </section> 

How do I stop this being generated so I can set the one, and only one, H1 in my page?


(allan kelly) #2

Umm, I wrote some HTML in the code which got removed and left the message unclear…

When I wrote “this just results in” I then had < h1 > and then the associated closing / tag
That is, H1 starts and ends with nothing in the middle


(Rob D) #3

My semi-ignorant way of dealing with this is to never use h1 within my content (I start with h2 and then, if necessary, go to h3, h4, etc.).


(Doug Bennett) #4

That is built into the theme (as it is in many themes). You can override the title on each page (in page inspector) and that will give each page a different h1 but will also appear in the title.


(Michael Frankland) #5

That’s a great explanation @teefers - thanks


(Rob Beattie) #6

@teefers @yuzool But those two elements are different aren’t they?

The Browser title is what appears at the top of the browser, for example 'My Home page’
The site title is the element that identifies the site - ‘Rob Beattie Cleaning Services’ - and will be the same on every page.

Doesn’t the confusion arise because RW treats the site title as an H1 which means that it and all the other pages on the site shouldn’t have a separate, additional H1 to identify the subject of the page - hence @Rovertek’s sugestion of using H2s instead.

I think there’s a podcast in this - certainly for me!

Rob


(Stuart) #7

@allankellynet

There are options. These are provided “as is” with no guarantees as its offered as a gesture of helpfulness, not formal support - which would fall into theme customisation and would be charged for accordingly. Fair enough?

PROBLEM
You want to completely remove the h1 inside the intro section.

SOLUTION
Add this jQuery to the page or site wide Javascript container:

$("#intro h1).remove();

Anticipating your next question…

PROBLEM
You want to keep the site title but you don’t want it to be a h1

SOLUTION
Okay… lets rewrite that header to be h2.

Step 1:
Add this CSS to the project so that your new h2 looks like the previous h1:

#intro h2 {
	color: #ffffff;
	font-size: 2rem;
	text-transform: uppercase;
	text-align: center;	
	text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

Step 2:
Add this jQuery to the page or site wide Javascript container:

$('#intro h1').replaceWith(function () {
    return "<h2>" + $(this).html() + "</h2>";
});

Yes, you can change the h2 to h3 or any other h level you feel like, but you’ll need to update the CSS too or it may look awful.

I hope this helps you to achieve your goals with Split.


(Doug Bennett) #8

Look again at the screen shot.

There are two fields and two green arrows. One is at the top is the browser title the second down at the bottom in the override section is labeled title.

This overrides the site title for this page. It’s the split theme and most other themes that treat the site title as the h1, not RW.

But it easy to change on the page level.

You can also set the slogan and footer at the page level (not in this screen shot) just below the title.


(allan kelly) #9

Thanks for all the replies.

@Rovertek - in terms of what the visitor sees H2 is fine for this but in terms of what Google sees H1 is more important. So this is an SEO question.

@kryten - comprehensive answer, only thing is, I’m using RW to avoid getting into code at all! I’ve also been caught out in the past when I’ve switched themes and lost (forgotten) modifications I’ve made.

@teefers @robbeattie looks like this is the work around, not great 'cos overriding the site anything stores up problems down the line when you do want to make a site wide change.

And agree, its a shame the Split theme (and probably others) assume site title is an H1, that is going to hit a lot of sites that want to be search engine friendly.


SEO report questions
(Doug Bennett) #10

This is really not a "Work around."
The “Site Title” is only used as a variable that is passed from RW to the theme. The reason all most every theme (except the "blank style themes, like foundry and foundation) use this as an h1 is that’s its purpose.
It’s much worse an SEO penalty not to have an h1 on the page than to have two. Since a lot of RW users don’t understand h1 vs. h2 vs. h3, never mind how content structure affects a site’s SEO ranking.
A great deal of RW sites are small sites about a single subject. Using the site title on every page does apply. RW does give you the ability to change that on each page.