Remove the “»” (») from your Wordpress title

September 29th, 2008

Wordpress puts a “»” (») in front of all blog archive entries. This had always bothered me. To remove this character, you have to find the function call to “wp_title()” in your theme. It should usually be in a file called header.php.
In fact when you call this function, you can send it a string, which will be prepended to the title. Unfortunately it is possible to define default parameter values in PHP and a lot of theme developers jsut don’t put any parameter in the wp_title() call. So you don’t know that it’s possible to give another value by the paramter. Just another reason why PHP just plainly sucks at being a serious computer language…

I replace the call to wp_title() with the following code:

<?php trim(wp_title("")); ?>

This removes the » and trims any whitespaces from the title.

BTW: It’s also very bad pratice to have the wp_content() function actually output the title and not having it return a string containing the title. Don’t even get me started about PHP developers…

10 Responses to “Remove the “»” (&raquo;) from your Wordpress title”

  1. Tom Says:

    Thank you very much for posting this information. This is the only site I’ve come across that actually told how to remove these characters from the title.

    Your code was all I needed to get my titles showing up like I wanted.

    Thanks again.

  2. Jamie Says:

    Thank you!!

  3. Shanx Says:

    Thanks! What an annoying feature this is from WP. And such a simple elegant solution :)

  4. Top Flat Irons Says:

    thanks buddy! was looking all over the styles.css to remove this, and yours was a quick a simple solution. thankyou!

  5. Loo Says:

    A CSS SOLUTION

    Add this to your css :

    .entry ul li:before,#sidebar ul ul li:before {
    content:”?? “;
    }

  6. Dan Says:

    Good resource :>.

  7. Christopher Masiello Says:

    Wow, this helps so much. What a simple, but usefull fix.
    Thanks,

    Chris

  8. Adam Says:

    Thanks for this quick and easy solution. You are awesome. -Adam

  9. Nathan Lee – Banishing “»” from wordpress titles Says:

    [...] to this guy here for the info. « Solar panels on government buildings.. A first [...]

  10. Kevin Says:

    Worked a treat :) Thanks

Leave a Reply