Archived topic
Clicking name on commnet leads to error
7 replies · Started by Jusung on July 31, 2022
When I get a comment on my post,
it shows the name, date and comment.
The name is clickable but when I click it,
I got an error.
I want to make it un-clickable.
Can you help with this?
when you see the comment section,
you can click the name of commenter.
I want to make it unclickable.
Hi there,
try adding this PHP Snippet to your site:
function disable_comment_author_links( $author_link ){
return strip_tags( $author_link );
}
add_filter( 'get_comment_author_link', 'disable_comment_author_links' );
How to add PHP: https://docs.generatepress.com/article/adding-php/
Hello.
Thank you for answering!
Is there a way to fix this by adding CSS code?
I don't want to download PHP Snippet Plugin just only for this.
Hi Jusung,
You can try this CSS if that’s what you prefer:
.comment-author.vcard > cite > a {
pointer-events: none;
cursor: default;
}
Hello. Fernando!
It perfectly works!
below author, the date is also clickable.
Can you also make the comment date un-clickable?
I found the solution in other post.
Thank you for helping!
I see. You’re welcome Jusung!