• The title tag in my blog has an arrow character (»), and i can’t figure out where it’s coming from.

    I’m using the Headspace2 plugin to control my titles, and the titles are what i expect based on my settings, except that they’re preceded by the arrow character.

    I believe the previous manager of the blog used some other plugin, but it’s not installed now.

    How can i trace what is causing the problem?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter elranchomzt

    (@elranchomzt)

    Can anybody at least tell me where to find the code for the wp_title() function? I’m no coding expert, and i’m not familiar with the WP code, so i haven’t been able to find it, but at least that way i could try to find out what is generating the unwanted character.

    Many thanks!

    Look in your theme’s header.php. Plugins may also have a dashboard settings page where you can adjust things like this.

    Nope, it comes from the core:
    wp-includes/general-template.php
    line #164
    (in WP 2.6.2)

    Nope, it comes from the core

    But you can change the separator in the header:

    <?php wp_title('-'); ?>

    https://codex.www.ads-software.com/Template_Tags/wp_title

    Thread Starter elranchomzt

    (@elranchomzt)

    Thanks a bunch, guys! I had modified the header.php file in the template, though i didn’t know you could specify a separator there. But i had no idea where to find the code in the core. Let me investigate and see what i find.

    Thread Starter elranchomzt

    (@elranchomzt)

    OK, that solved it! Looking at the code i realized that wp_title() without any arguments defaults to prefixing the title with the default separator character.

    All i needed to do was change my template file header.php to call wp_title(”) so that the separator character is now a null character, and the unwanted character at the start of my titles is gone! ??

    FWIW, it seems like a sort of strange default to me to prefix titles with the &raquo; character

    FWIW, it seems like a sort of strange default to me to prefix titles with the » character

    The assumption is that you’ll prefix the page title with your site title, and so want a separator to go between them.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘<title> has unwanted characters in it’ is closed to new replies.