WordPress Genesis: How to remove H1 tags and page titles from header if not on a homepage

As you scan your site for opportunities to optimize, your SEO results will probably tell you that on certain pages of your website you have two or more H1 tags.  By far not the most egregious of violations, you don’t want to confuse those simple-minded robots called search engines that can’t figure out the first H1 tag is more important than the second <h1> tag when they crawl each document on your site much like they already assume with HTML 5 and <header> tags which they encounter more and more every day.

That being said, pre HTML5 pages should abide by the general rule that you should only use ONE H1 tag per page — if nothing else to pay homage to those reminiscent times of rogue, cowboy coding with little restrictions and standards that brought us such great innovations as link farms and “what else can we do to trick the search engines because we’re too lazy to focus on actually building our business” strategies that still seem to prevail throughout the web.

If you are using WordPress and a Genesis theme, you might do a lot of googling before coming across this snippet.  How do you shut off the H1 tag in the WordPress headers on every page but the homepage in this darn framework?!  As much as I like Genesis, they should have a simple guide or cheat sheet for all their extended functions based on the WordPress core.  Don’t you love those themes and plug-ins that make you type their name in every instance within your code?  They may think having to type “genesis” everywhere is a form of branding, to me, it’s the kind of painful branding I try to avoid — much like the gasp of pain a cow would make after getting branded with a hot iron.

  *    Remove Site title tag if not homepage

add_filter( ‘genesis_seo_title’,’conditional_title’ );

function conditional_title($title) {
if ( !is_front_page() ) :
     $title = ”;
   else :
    return $title;

Don’t get me wrong, I think Genesis is a good Theme Framework for WordPress, they have excellent products and support, but wouldn’t an option to just type “gen_” do?! Anyway, here’s the fix based on the problem mentioned in the title. Aaron Belchamber

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

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