Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 16 months ago

#24203 closed defect (bug) (fixed)

Remove the_title_attribute() from anchors with the_title() as text

Reported by: nacin's profile nacin Owned by: lancewillett's profile lancewillett
Milestone: 3.6 Priority: normal
Severity: normal Version: 3.0
Component: Bundled Theme Keywords: has-patch needs-codex
Focuses: Cc:

Description

This:

<a href="(link)" title="Permalink to Post Title">Post Title</a>

is redundant. It is an anachronism from earlier themes that does nothing for accessibility, search engines, or general users, and if anything, harms all of the above.

We should remove the_title_attribute() whenever the anchor text is the_title().

More: http://make.wordpress.org/accessibility/2013/04/23/post-titles-in-attributes/

Patch for four bundled themes incoming.

Attachments (1)

24203.diff (18.1 KB) - added by nacin 11 years ago.

Download all attachments as: .zip

Change History (13)

@nacin
11 years ago

#1 @philiparthurmoore
11 years ago

  • Cc philip@… added

#2 @lancewillett
11 years ago

  • Keywords 2nd-opinion added

Noted, and thanks for the ticket and patch. I'd like to think this through a bit before committing, including a look back at where it came from and what it's intended purpose was in the beginning.

I don't think I'd go as far as to say it's harmful, but fully agree it looks like cruft at this point and it would be a nice to clean it up.

#3 @nacin
11 years ago

It's harmful in two instances:

  • One, useless tooltips are a big turn-off. It's one of the reasons we got rid of tooltips for images by default in 3.5. Almost every time, the tooltip was going to be one of three things: the caption (redundant), the alt text (misapplied and redundant), or "IMG_5678" which was one of the lamest things in WordPress. You hover over a title that says "Permalink to (title)" and you just know you're on a WordPress site. My point is it isn't just code cruft, it is cruft that the user sees too.
  • More so, it is definitely harmful when it comes to accessibility. There is a long-standing, strong opinion in the accessibility community (a little bit on the make thread I linked to) that title attributes are terrible and useless. They are either ignored by screen readers, or double-read by screen readers. They can also pose a problem for dyslexic users. Experts have outlined a number of other issues with them, and the HTML5 spec actively discourages them.

#4 @lancewillett
11 years ago

  • Keywords 2nd-opinion removed

Confirmed with research—and a sanity check from @themeshaper—that this has been around since "default" (Kubrick, see r2012) and has been passed along to each default theme since then. I didn't find an initial reasoning for it, and I think it's safe to remove based on the arguments present above.

#5 @lancewillett
11 years ago

  • Owner set to lancewillett
  • Resolution set to fixed
  • Status changed from new to closed

In 24131:

Bundled themes: remove the_title_attribute() title attributes where it duplicates the_title() in anchor text. Props nacin, fixes #24203.

#6 @DrewAPicture
11 years ago

  • Keywords needs-codex added

#7 @audrasjb
16 months ago

In 54884:

Twenty Eleven: Remove useless title attributes.

This changeset removes title attributes from various links, as they are adding redundant information.

Props sabernhardt.
See #57199, #24766, #24203.

#8 @audrasjb
16 months ago

In 54885:

Twenty Nineteen: Remove useless title attributes.

This changeset removes title attributes from links, as they are adding redundant information.

Props sabernhardt.
See #57199, #24766, #24203.

#9 @audrasjb
16 months ago

In 54922:

Twenty Ten: Remove unwanted title attributes.

This changeset removes title attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

#10 @audrasjb
16 months ago

In 54923:

Twenty Thirteen: Remove unwanted title attributes.

This changeset removes title attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

#11 @audrasjb
16 months ago

In 54924:

Twenty Twelve: Remove unwanted title attributes.

This changeset removes title attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

#12 @audrasjb
16 months ago

In 54925:

Twenty Twenty: Remove unwanted title attributes.

This changeset removes title attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

Note: See TracTickets for help on using tickets.