Removing Page Titles In Thesis

February 2

Toolkit for websites

Updated Nov 12, 2010:

There is a better way! I suggest checking out the newer article on the topic to learn how to remove page titles in thesis using filters.

There were a couple of threads in the DIYThemes forum about removing page titles.  Lots of solutions were thrown out including hiding the title with CSS rules like:

    h1 { display: none;}
While this does work, it’s not really a recommended solution because of the possibility of being construed (by the search engines) as a nefarious, evil, black hat technique. Oooooh hand waving.

I suggested that the easiest way is just to chop the titles straight out of the PHP code and be done with it. No need to hide, align, obfuscate or anything tricky on the presentation end. [Update 10/04/2010: I am not sure I would worry too much about hiding text for presentation purposes affecting your rankings.]

What’s Involved?

This can be as simple as commenting out 2 lines of code.  If you aren’t comfortable with mucking around with your thesis files, please don’t. But I expect even beginners can achieve this by following the directions. (Famous last words.)

This modification assumes that you don’t need titles to display on any Page (not Posts) within your WordPress website (it removes it from every pages on your site).

Keep in mind — that we are going to modify the php templates within Thesis, not the Custom files.  This is usually a no-no only because if you upgrade your theme (or reinstall for whatever reason), you will lose your changes.  Not the end of the world, but you should keep this in mind and possibly back up your changed files.  (You do back up your site frequently anyway, right?)

Let’s Begin

Just comment out line 36 & 37 from \lib\functions\content.php (This is in Thesis 1.6)

Looks like this below: (starts on line 33)

Thesis Remove Page Titles

Change this:

elseif (is_page()) {
    if (is_front_page())
        echo ' <h2>' . get_the_title() . '</h2>' . "\n";
    else
        echo ' <h1>' . get_the_title() . '</h1>' . "\n";

to this:

elseif (is_page()) {
    if (is_front_page())
        echo ' <h2>' . get_the_title() . '</h2>' . "\n";
    //else
        //echo ' <h1>' . get_the_title() . '</h1>' . "\n";

Things To Consider

The only issue you may see is that the formatting will leave a gap where the title used to be, but that could be worked around with some extra css rules.

Let me Know How It Goes

Did this tutorial answer your questions? Did you use it on your own site?  Please leave a comment.

Clip to Evernote

You may also enjoy these related posts:

{ 8 comments }

Jenn March 15, 2010 at 5:09 pm

Perfect! Thanks so much :)

Samuel April 13, 2010 at 8:42 pm

solved my problem. Thanks a lot.

jasper zwarts October 3, 2010 at 5:47 am

Hi,

I’m now running thesis 1.8 and the code has changed significantly.
Do you have an update for removing the title in the new Thesis release?

Thanks in advance,
Jasper

Jim October 4, 2010 at 9:34 am

To be honest, I have revised my own advice above and just hidden the h1 display with CSS. This is just based on a lot of confirmation I’ve gotten about this type of thing not being penalized by the search engines.

For example div.headline_area h1 { display: none; }

I think Google & Co. are smart enough to know when someone is doing it to be sneaky or just to for design purposes.
Do whatever makes you comfortable, but it also has the side benefit of not breaking your theme code on each update of Thesis.

I hope this helps.

Tia October 26, 2010 at 10:56 pm

Thanks. I noticed that when I add .headline_area h1 { display: none; } to custom CSS , it also removes the titles from posts. Any ideas?

Jim October 28, 2010 at 2:08 pm

You may want to experiment with adding a custom CSS class (on the post editor page) to any page where you want to hide the text. This will allow you to be more specific about this entry. There are more ways, but this is probably the easiest one (unless you have hundreds of pages).

Specify a custom class of hide-me and then modify your css to add the following:

.custom .hide-me .headline_area h1 {display: none;}

That should do the trick.

Karl November 5, 2010 at 1:51 am

Is there anyway just to remove the page title on the home(static) page and the new blog page?

Jim November 12, 2010 at 1:28 pm

I suggest you go check out this article, which is a better way to remove page titles in thesis using filters. I hope this helps.