Forums

[resolved] How To Capitalize The First Letter Of Every Word In Page Titles For SEO (8 posts)

  1. Floyd3
    Member
    Posted 1 year ago #

    Hi, is there a way to capitalize the first letter of every word in page/post titles?

    Not in the page itself, but I mean in the <title></title> tag, so it looks good to search engines.

    Something to do with the "text-transform: capitalize" tag maybe? Where would this go?

  2. Floyd3
    Member
    Posted 1 year ago #

    Also, not sure if it matters, but my site is here: http://www.pinkfloydtabs.com and I use the All in One SEO plugin to write the title's for my pages.

    Anyone know how?

  3. Matthew Gedeon
    Member
    Posted 1 year ago #

    It's unlikely that a css text-transform would change how things display in search results. You can take the title and capitalize it in the all in one seo box at the bottom of the post or page. You could hire a developer to modify the plugin if you like.

  4. Floyd3
    Member
    Posted 1 year ago #

    Thanks Matthew, what I'm actually trying to do is make ALL UPPERCASE only part of the title, so it's something like this PinkFloydTabs.com | NAME OF PAGE | Pink Floyd Tabs

    It seems like this shouldn't be too hard to do, I'd like to figure it out without hiring a developer if possible.

    Any ideas?

  5. Floyd3
    Member
    Posted 1 year ago #

    I tried putting <?php echo strtoupper('This is the title to be uppercase'); ?> but it didn't work...

    So I've tried a PHP way of doing it, and CSS way, but still no luck.

    Am I close?

  6. Floyd3
    Member
    Posted 1 year ago #

    Figured it out if anyone reading this eventually might be trying to do this. Add this code to your header.php file to make the title all UPPERCASE:

    <?php
    function captitle($title) {
         $title = strtoupper($title);
         return $title;
    }
    add_filter('wp_title', 'captitle');
    ?>
  7. Matthew Gedeon
    Member
    Posted 1 year ago #

    Way to go! I was wondering why the the php approach didn't give you what you wanted. Just have to get it formatted correctly and in the right place.

  8. Floyd3
    Member
    Posted 1 year ago #

    Thanks :) and thank you for your help too.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.