Add Title Attributes to SquareSpace Links

CR Rollyson
3 min readJan 18, 2024

--

If you know why SquareSpace doesn’t inherently add link title attributes, I’d appreciate the insight. I couldn’t find any info.

You are likely here because you work in SquareSpace and are a UX, SEO, Accessibility, WTF expert and needing a solution to get title attributes added to SquareSpace links.

You can do what I’m about to suggest and you can do other stuff, but this is what I’m doing and offering up as 1 of many solutions:

  1. In your SquareSpace website dashboard, navigate to:
    Website > Website Tools > Code Injection
  2. In the Code Injection View, in the Footer block — add (this will be sitewide and that isn’t a bad thing):
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
$(document).ready(function() {
// Select all anchor tags
$('a').each(function() {
var linkText = $(this).text(),
linkTitle = $(this).attr('title');
if (!linkTitle) {
$(this).attr('title', linkText);
}
});
});
</script>

3. Open a browser and inspect a link to confirm the title attribute is being added.

Notes:

  • This code copies the link text being displayed and sets it as the title attribute, if a title attribute does not already exist (protect existing link titles that may exist). It can be modified to suite whatever requirement, if you are willing. At the very least, doing the very least is a good move. And this is that baseline. Tongue twister.
  • If you already have jquery loading, remove the script src include.
  • This can be refactored for vanilla javascript, if you are opposed to including jquery.

After that, you’ll have link attributes being added.

Have questions, comment and I’ll get back. Read on to gain insight on why adding link titles is important √

Why Adding Link Titles Is Important In General

Link title attributes can offer several benefits for SEO (Search Engine Optimization). Here’s a list of the advantages:

  1. Improved Accessibility:
    Link title attributes provide additional information about the linked content, enhancing accessibility for users who rely on screen readers. This makes your website more inclusive and user-friendly.
  2. Enhanced User Experience:
    When users hover over a link, the title attribute can display additional information, giving users a preview of where the link will take them. This can improve the overall user experience and help them make informed decisions about clicking the link.
  3. Keyword Relevance:
    Including relevant keywords in the title attribute can contribute to the overall keyword strategy for your page. Search engines may consider this additional information when determining the relevance of your content to specific search queries.
  4. Contextual Information:
    The title attribute allows you to provide context or supplementary details about the linked content. This can be particularly useful for ambiguous or generic anchor text, helping users and search engines understand the context of the link.
  5. SEO-Friendly Anchor Text:
    If you prefer to keep anchor text concise for design or aesthetic reasons, the title attribute allows you to provide more detailed information without cluttering the visible text. This can be beneficial for maintaining a clean and organized webpage layout.
  6. Increased CTR (Click-Through Rate):
    Providing informative title attributes can entice users to click on the link by offering a clearer understanding of what they can expect on the destination page. This can lead to a higher click-through rate, which is a positive signal for search engines.
  7. Cross-Browser Compatibility:
    While modern browsers generally display title attributes, they can serve as a fallback for situations where the link text might not be fully visible or accessible. This ensures a consistent experience across different browsers.
  8. Schema Markup Integration:
    Utilizing title attributes in conjunction with schema markup can provide search engines with even more structured information about your content. This can potentially enhance the visibility of your page in search results.
  9. Tooltip Information:
    In addition to improving accessibility, the title attribute often appears as a tooltip when users hover over a link. This can offer a quick preview of the linked content, helping users decide whether to click on the link.
  10. SEO Best Practice:
    While not a direct ranking factor, implementing best practices across your website, including optimizing title attributes, contributes to a well-structured and user-friendly site. Search engines appreciate websites that prioritize user experience and accessibility.

If you found this helpful, like > follow > share > comment.

CR Rollyson is a Digital User Experience & Web Manager for a S&P 500 Fintech company and is the COO of Side Role, a marketing team in Charlotte North Carolina partnering with In-house Teams & Agencies, Non-profits, and Start-Ups. Learn more about Side Role here.

--

--

CR Rollyson
CR Rollyson

Written by CR Rollyson

UX & Web mgr for a S&P 500 Fintech & COO of Side Role, a marketing team partnering w In-house Teams & Agencies, Non-profits, & Start-Ups. https://siderole.com

No responses yet