WordPress Page Links and Title Attributes

I only just realised (shows how much attention I pay) that the pages I create in WordPress automatically get title attributes on the links which contain the same content as the anchor text (go on, hover over one of the pages up the top such as ‘About’ and you’ll see a little tool tip pop up with the content ‘About’). This is produced by using the wp_list_pages() template tag within the WordPress template. Frustrating too because it’s a waste of time having that there as there is no point in repeating the anchor text.

A title attribute should be used to description the object, in this instance the link, more accurate. For example ‘About’ would be ‘About the author’. Afterall, ‘About’ on its own is pretty ambiguous. It’s good to use on image links too, afterall the alt attribute should simply describe the image, not what it’s linking to.

You’re probably thinking ‘so just hardcode the pages’. That’s fine for my own sites, but we use WordPress to power a couple of client sites. They use the blogging facilities and so I’ve simply used WordPress as a CMS to wrap everything up into one. That’s where the problems start as clients don’t handcode their menus, they rely on the dynamic coding to do this for them.

Looking around I can see someone else has noticed this issue but hasn’t seemed to have got an answer of how to fix it. I could probably go into the WordPress core code and hack the function to not display a title attribute, but I’m not a fan of doing that as I have to update the file on every update. When you have around 10 sites to upgrade it’d be a bit frustrating! Especially if they altered the code putting you back to the first step again.

So for now I’ll have to put up with it, have a look for a plugin that can remove it for me and see if there’s a request for it to be removed or the option to write your own attribute. Afterall, there’s a great plugin to write your own Title tags, so why not link title attributes?

You may also like...

3 Responses

  1. Tom says:

    I am also seeking a solution to this. I found a WP plug-in for menu management that allows blank title attributes but this renders an empty yellow box in Safari.

  2. Aaron Wall says:

    Great helpful information, Thanks for this nice post, just subscribed your feed, hope you will update new post soon.
    keep it up.

    Aaron.

Leave a Reply

Your email address will not be published. Required fields are marked *