Better SEO Titles in WordPress 2.5 Chris Poteet, March 30, 2008August 27, 2023 A bane of WordPress development for a long time were the awful titles generated for blog posts. When I speak of this I’m talking about the order of the blog title and the post title are put together. An example of this can be found below. And this example is better than other’s I’ve seen. On some sites where the blog/post title is long then the post title is truncated! This is unacceptable when search engines give so much weight to the content of your post titles. For a long time I circumvented this behavior by using the Optimal Title plugin. It worked fine, but it was yet another plugin for something that should’ve been inside the core. So I opened ticket #4407 to integrate the plugin architecture into the core. I created a patch, and it became changeset 6,538! In short, I added a parameter into wp_title() that sets the location of the separator. By default, it goes to the left, but you can move it to the right by specifying it. If you don’t specify anything it defaults to the legacy behavior of going to the left. This is the code you can now use to generate sexy SEO titles: <?php wp_title('&raquo;',true,'right'); ?> <?php bloginfo('name'); ?> This will print: Post/Page Title » Blog Name. By ensuring that you specify meaningful titles for your postings then you can ensure that your findability will increase. The official documentation on this function has also been updated to include this change. Related Posts Content Management Tutorials WordPress BloggingFindabilityPHPseoThemestitles
Good job. That has to be a great feeling, getting one of your changes added to the core like that. Keep up the good work Reply