Recognising HTML anchors
To make sense of this post about ‘mouseover tooltips’, you will want to be able to recognise what the HTML code for a link (known as an ‘anchor’) looks like, which is this:
<a
href="web address -- AKA 'URL' -- goes here"
>
Link text goes here
</a>
If you don’t feel confident about recognising an anchor, you may want to refer to this post, which I wrote back in February.
About tooltips
Before going further, I should explain, in case you don’t know, what I mean by a ‘mouseover tooltip’. This is text that appears when you hover the mouse over a link. (Since you can’t do this on a smartphone, these tooltips have no effect in that environment.) I’ve added these ‘tooltips’ to the links in this post — go ahead and hover your mouse over this one, for instance, to see what I mean. These can be quite handy, because they can give you extra information on where a link goes before you actually follow it. (I don’t know why WordPress doesn’t have this functionality already built in.)
Switching between ‘visual’ and ‘code’ views
First off, you need to know how to switch between the default ‘visual’ view and the ‘code’ (HTML) view of a page in WordPress. In the Classic Editor, this is easy to do: there are two tabs on the right-hand side labelled ‘Visual’ and ‘HTML’. The downside here is that the ‘HTML’ view shows you the HTML for the entire page, so you may have to hunt to find the anchor you’re looking for.
In the Block Editor there are three ways to switch between views. Probably the most convenient is to change the view of just the block that you’re working on. You do this by using the ‘More options’ button for the block (looks like three dots in a horizontal row) and then selecting ‘Edit as HTML’ or ‘Edit visually’ to toggle between the two views.

Alternatively, you can change the view of the entire page using the hotkey combination Ctrl+Shift+Alt+M, or you can use the ‘More tools & options’ button (looks like three dots in a vertical row just to the right of the green ‘Jetpack’ symbol), and then choose ‘Visual editor’ or ‘Code editor’ from the ‘Editor’ section.
Adding a title attribute to a link
An anchor HTML element can contain a number of ‘attributes’. The one that we’re interested in is the ‘title’ attribute — this is what should show on a mouseover.
So… first you add a link to some text (highlight the text you want the link to appear on, click the ‘Link’ button for the block — shortcut Ctrl+K — enter the URL). Then:
- switch to HTML view
- find the anchor code for the link
- add a title attribute, so it looks like this:
<a title="mouseover tooltip text here" href="URL here">link text here</a>
Switch back to ‘visual’ view, hover your mouse over the link, et voilà!
If you have any questions, please don’t hesitate to shout out in the comments.
H/T to Bella of ThoughtsnLifeBlog for encouraging me to create this post.
Thank you for writing this, I will attempt to try this on one of my posts.
LikeLiked by 2 people
Give me a shout if you need a hand. It’s really not that difficult once you know what you’re looking at.
LikeLike
Will do.
LikeLiked by 1 person
This post is very well written in a sense that anyone can understand it. You provide explanations for everything. It’s also a very helpful post. However… my hyperlinks always do that without me needing to edit anything. If I open a post of mine through the website, I hover over a link and see the address. If I am editing my own post, when I click on the link, it highlights the text and shows the web address underneath it. So… hmm…</b.
LikeLiked by 2 people
Ah, you’ve pointed out something that I’ve failed to point out: the ‘title’ attribute allows you to specify the text that appears on the mouseover — not just the address. Thanks for highlighting that oversight! (Now, how best to fix it, ummm….)
LikeLiked by 1 person
Ahh, good to know.
You’re welcome. I am always up to cause havoc.
LikeLiked by 1 person
Havoc can be fun :D
LikeLiked by 1 person
Wow! Maybe you should become one of those “happiness engineers at WP” as this is helpful info. I wracked my non-tech brain the last few days trying to find out how to view something in HTML on Gutenberg (even though I’m not well-versed in HTML but at times was able to make minimal alterations this way in the Classic Editor). Thanks for your help!
LikeLiked by 2 people
You are very welcome. Glad I could help.
LikeLiked by 1 person
Spent an hour of scouring the junk on the net to find this. I knew there was a simple solution, thanks a ton. Cheers!
LikeLiked by 2 people
Cool, glad I was able to help! :)
LikeLike
Anyone have the issue of wordpress automatically removing the “title” and coming up with ? It worked at first, but I wasn’t even finished with the doc before it changed by itself.
LikeLiked by 1 person
rel=”noreferrer noopener”
LikeLike
Hmm… This could be a red herring, but what do you have set in wp-admin Settings > Reading > Site visibility, do you have ‘Discourage search engines from indexing this site’ enabled? If so, that might be the problem. But I admit that I am just guessing: you could try asking WordPress Support for assistance.
LikeLike
Pingback: How to quote someone else’s words in a WordPress comment | Wibble
Pingback: Let’s Get Inspired by pendantry of the blog called Wibble – Part 1 of 2 – ThoughtsnLifeBlog
Pingback: Let’s Get Inspired by pendantry of the blog called Wibble – Part 2 of 2 – ThoughtsnLifeBlog
Pingback: Yes, it IS possible to embed hyperlinks in titles! (but there are caveats) | Wibble