WordPress Permalink: How to Change the Title Attribute
Performing SEO on a WordPress powered website is not without its complications. Dynamically generated content is great for easy publishing while maintaining uniformity, but when it comes to SEO each page should be optimized separately, which can be difficult.
There are a lot of SEO WordPress plug-ins that will make it easy to configure almost everything required to perform the onsite tasks for SEO, but one thing that seems to be left by the wayside is the ability to modify the “title” attribute from “Permanent Link to (page title)” to something more optimized for your website.
Default Theme
If you are using the traditional WordPress home page (the one that displays your recent posts) you will need to open up the index.php that resides in your themes folder:
(http://www.yoursite/wp-content/themes/yourtheme/)
Now, you need to find the first <h2> tag in the document. The layout of the code around the <h2> tag will vary, so this tutorial will use the default theme.
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></h2>
You can change the code highlighted in red to whatever you wish. I would recommend not changing any of the PHP code after the red highlighted code (but still between the quotes) because otherwise, every page’s permalink will be exactly the same.
Using An Artisteer Theme
To optimize the permalink title attribute on your pages if you are using an Artisteer theme you will need to open up the page.php that resides in your themes folder:
(http://www.yoursite/wp-content/themes/yourtheme/)
Now, you need to find the first <h2 class=”art-PostHeader”> tag in the document.
<h2> <a href=”<?php the_permalink() ?>” rel=”bookmark” title=”<?php printf(__(‘Permanent Link To %s’, ‘kubrick’), the_title_attribute(‘echo=0’)); ?>”><?php the_title(); ?></a></h2>
You can change the code highlighted in red to whatever you wish. I would recommend not changing any of the PHP code after the red highlighted code (but still between the quotes) because otherwise, every page’s permalink will be exactly the same.