Site logo

Archived topic

Displaying author without link

3 replies · Started by Eric on June 27, 2021

Viewing posts 1–4 of 4

Hi. I want to continue displaying the author of my blog posts on the post pages and the archive page. However, I want to remove the link to their author page. I'm not utilizing the author pages for seo reasons, and these pages are set to redirect to my homepage instead.

How can I replace the author names with a version that doesn't include a link? Thanks!

Hi there,

There are different methods of doing this.

The simplest one is by CSS:

span.author.vcard a {
    pointer-events: none;
}

This prevents any clicking on the link but the hover styling will still be active. The drawback here is, it doesn't remove the anchor tag and the link is still there.

Another method is by completely removing the link tag itself.

Here's a PHP filter for removing it.
https://docs.generatepress.com/article/generate_post_author_output/#remove-link

Here's how to add PHP snippets - https://docs.generatepress.com/article/adding-php/

The filter to remove author link worked perfectly. Thank you.

No problem. glad to be of any help. :D

This archived topic is closed to new replies.