How to customize, force or remove the “Read more” link in the Astra theme

astra theme templates

The Astra theme is one of the most installed WordPress themes and it is so because of its many virtues and possible customizations, but there is always something else we can improve.

Today we are going to see some customizations that we can do in the text or “Read More” button of the blog file template in Astra.

Customize the “Read More” text

This I think would be the first thing we would want to customize, and nothing is easier, if you have Astra Pro.

Just open the WordPress customizer and in the customization section of Blog > Blog/Archive, change the text to the one you prefer.

read more astra settings

In the meantime, you can select whether you prefer to display it as linked text or as a button.

But what if I don’t have Astra Pro, if you only have the free version, in this case the trick would be to add the following function to the functions.php file of the Astra child theme.

%MINIFYHTMLe4d4224b6622e60a071a18ee5b3a656958%
//Change the «read more» text function astra_post_read_more() { return __( 'Keep reading ....', 'astra' ); } add_filter( 'astra_post_read_more', 'astra_post_read_more' );

As you can imagine, you just have to change the “Keep reading …” for the text you like.

Do not show “Read more”.

If, on the other hand, you prefer that the “Read more” is never shown in the blog archives there are two ways to achieve this.

Create manual excerpts

A curious method that I discovered almost by chance is to create manual excerpts, because in that case Astra – for some strange reason – does not show the “Read more”.

excerpt position in post settings

So, if you are used to create manual extracts (something I always recommend and do), that’s it, you don’t have to do any more, Astra will not show the “Read more” even if they are activated and/or customized.

Remove them globally with a code

Now, if you prefer that they are never shown, even if you don’t use extracts, then nothing is faster and more effective than adding the following code to the functions.php file of the Astra child theme:

//Remove «read more» globally function wphelp_remove_read_more() { return __( '', 'astra' ); } add_filter( 'astra_post_read_more', 'wphelp_remove_read_more' );

Save the changes and that’s it, you won’t see “Read more” anymore

Always show “Read More”

In addition to what we have already seen, there are times when the Astra theme does not show the “Read more”. For example, if your post has a shortcode block, code or pre-formatted text, it will not be shown.

And also, as we have seen before, if you create a manual extract.

Now, do you always want to show “Read more”, even in the above situations? Even if you have created a manual extract or there are code blocks, etc.?

The solution is to add this code to the functions.php file of the child theme:

/* "Read more" everywhere in Astra */ add_action( 'after_setup_theme', function () { // Remove "Read more" added by Astra remove_filter('excerpt_more', 'astra_post_link', 1); // Add "Read more" in all entries add_filter( 'the_excerpt', function ($content) { return $content . astra_post_link(); }, 99 ); // Remove "..." added by astra add_filter( 'astra_post_link', function ($value) { return str_replace("…", "", $value); } ); } );

You save the changes and that’s it, “Read more” is always visible.

And that’s it for today. You already know a little bit more about how to customize Astra to your liking, even if you don’t have the Pro version.

Read this post in Spanish: Cómo personalizar, forzar o quitar el enlace de «Leer más» en el tema Astra

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

Leave a Comment

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

Scroll to Top Skip to content