• Hello, I’m having an issue with the GeneratePress template regarding the “Read more” links on the blog. Pagespeed Insight reports that these links lack alt text (Alternative text for links helps search engines understand your content). How can I fix this? I’ve tried tinkering with a snippet but haven’t had any luck. There’s a similar issue in terms of accessibility (Visible text labels that do not match the accessible name can result in a confusing experience for screen reader users). How can I fix read more URL and how can I get ALT TEXT on these links on my blog?

    Thanks for you support

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    the: Visible text labels that do not match the accessible name can result in a confusing experience for screen reader users)` has been patched in the next release of GeneratePress which is currently in alpha release.

    The missing alt text – that makes no sense on the Read More Links. Are you sure its not an issue with an Image within a Link that has no alt text ?

    Thread Starter jirivanek626

    (@jirivanek626)

    Thanks for response. All images have Alt Text so there could not be problem. Page speed show me problem on Read more link – https://ibb.co/mNJ8xS3

    Ah thats because of this:

    https://developer.chrome.com/docs/lighthouse/seo/link-text/?utm_source=lighthouse&utm_medium=lr

    you can filter the Read More text to something else using this snippet;

    add_filter( 'generate_excerpt_more_output', function() {
        return sprintf(
            ' ... <a title="%1$s" class="read-more" href="%2$s" aria-label="%4$s">%3$s about %5$s</a>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) ),
            __( 'Continue Reading', 'generatepress' ),
            sprintf(
                /* translators: Aria-label describing the read more button */
                _x( 'Continue Reading about %s', 'more on post title', 'generatepress' ),
                the_title_attribute( 'echo=0' )
            ),
            get_the_title()
        );
    } );

    In this example i changed it to Continue Reading

    Thread Starter jirivanek626

    (@jirivanek626)

    Am I understanding correctly that the issue lies solely with the generic ‘read more’ link text and that changing it to something else should suffice? I tried adding your snippet to the blog, but the only effect was that the clickable button broke. It disappeared, and only text appeared in its place.

    Thread Starter jirivanek626

    (@jirivanek626)

    So I’ll add that I use Polylang. The Czech version is fine, there’s no SEO issue there. It’s only the EN version. Therefore, I need to change it in the EN version where the original ‘Read more’ is. The Czech translation is not affected by this phenomenon.

    Yes, that’s correct. Try updating David’s code to this:

    add_filter( 'generate_excerpt_more_output', function() {
        return sprintf(
            ' ... <p class="read-more-button-container"><a title="%1$s" class="read-more" href="%2$s" aria-label="%4$s">%3$s about %5$s</a></p>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) ),
            __( 'Continue Reading', 'generatepress' ),
            sprintf(
                /* translators: Aria-label describing the read more button */
                _x( 'Continue Reading about %s', 'more on post title', 'generatepress' ),
                the_title_attribute( 'echo=0' )
            ),
            get_the_title()
        );
    } );
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ALT text on “Read more” links’ is closed to new replies.