As a WordPress expert with over 5 years of experience building and optimizing WordPress sites, I often get asked about the best way to direct readers to a specific part of a post.
Why Reference Specific Sections?
With over 455 million websites using WordPress as of 2023, content creators need to be conscious of the user experience. According to surveys, articles over 2,000 words see about 60% drop off in average readership.
By linking directly to the relevant paragraph or sentence needed to support your point, you can improve engagement.
Here are some common use cases:
- Journalists/bloggers attributing quotes
- Creating scannable content and calls to action
- Directing users from social shares
- Referencing information in long-form guides and manuals
Method 1: Anchor Links for Internal WordPress Links
Anchor links allow guiding WordPress site visitors to specific spots on a page marked by an ID attribute.
Step-by-Step Guide:
- In the text editor, highlight the section you want to link to and open the "HTML" tab
- Add an
id
attribute like:<h2 id="my-heading">My Heading</h2>
- Save changes to anchor element
- Construct HTML link using the ID:
<a href="#my-heading">See Heading Section</a>
For example, here is anchor link to the heading below:
Benefits of Anchor Links
Benefits of Anchor Links
Using anchor links for internal WordPress linking offers the following advantages:
- Browser support: Works across all modern browsers
- Reliability: Doesn‘t depend on external services
- Highlighting: Can add CSS styles for visual markup
- Backwards compatability: Won‘t break from content changes
When to Use Anchor Links
Based on my experience managing enterprise WordPress sites, I would recommend anchor links in the following scenarios:
- Linking to sections within your own WordPress site
- Creating table of contents for long posts
- Long-term maintenance is important
- Full browser and device support needed
Method 2: Link to Text Fragments for External Sites
For linking to specific text on sites outside of your control, Chrome‘s Link to Text Fragment feature enables accurate references:
How Link to Text Fragments Works
- Highlight the text on page you want link to
- Right click and copy the link to the highlighted text
- Paste link where needed
When clicked from a compatible browser, this will scroll to and highlight the selected text.
Sample link:
https://example.com/#:~:text=Selected%20text%20highlighted%20here
Advantages of Link to Text Fragments
Based on my testing, some benefits of using Link to Text fragments include:
- Links to uneditable external sites
- Scrolls and visually highlights referenced text
- Streamlined link creation process
When to Use Text Fragment Links
I recommend utilizing Link to Text Fragments when:
- Referencing 3rd party content not on your WordPress site
- Want visual emphasis for quoted text
- Only need to support modern Chrome-based browsers
Method Comparison
Feature | Anchor Links | Text Fragments |
---|---|---|
Browser Support | All modern | Chrome 80+, Edge |
Internal vs External Links | Internal WP sites | External sites |
Edit Page Source Needed | Yes | No |
Visual Highlighting | No, CSS needed | Yes |
As you can see, each method has specific use cases. Choose the right approach based on where content is hosted and intended audience.
Conclusion
Directing WordPress visitors to precisely the information they need improves user experience. Both anchor linking and Link to Text Fragments have benefits depending on intended use cases.
Let me know if you have any other questions on advanced linking best practices for WordPress!