How to remove links from featured Astra blog images

astra theme templates

If you use the Astra theme and are very aware of the SEO of your website you may have considered removing the links to the blog’s featured images.

Why should I remove the links from the featured images?

Why? Well, because the theory is that there should be no more links on the pages of your site than necessary, and it may be redundant that on the same page there are up to 3 links to the same URL:

  • The title of the entry.
  • The highlighted image.
  • The read more button.

So, if you want to have control over the links, and remove those you consider to be redundant, one tactic would be to at least remove the link to the post from the featured image.

How do I remove links from Astra’s featured images?

Very easy, it will take you less than 1 minute.

The code you have to add to the functions.php file of the Astra child theme is this:

%MINIFYHTML972cc9f13b12392047de92e72f7a2a5c58%
/* Remove links from featured images to entries */ function astra_remove_link_before( $markup ) { $markup = __return_empty_string(); return $markup; } function astra_remove_link_after( $markup ) { $markup = __return_empty_string(); return $markup; } add_filter( 'astra_blog_post_featured_image_link_before', 'astra_remove_link_before' ); add_filter( 'astra_blog_post_featured_image_link_after', 'astra_remove_link_after' );

Save the changes and now the highlighted images of the blog will no longer have links to the entries, only the title, or if you have activated it, the “Read more” button.

Why haven’t you removed the links from the featured images?

Good catch!

It turns out that I am even more concerned about usability, about the user experience, than I am about SEO, so since it is well known that the average Internet user assumes when he sees an image related to an entry that it will link to it, I have preferred to leave the links, to make navigation easier.

My thing is that I always prioritize the user experience to the SEO algorithms, which do not always match, even though they should.

Read this post in Spanish: Cómo quitar los enlaces de las imágenes destacadas del blog en Astra

Click to rate this post!
[Total: 1 Average: 4]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top Skip to content