Archived topic
Why do Generatepress add "#more-3741" to url's with the read more buttons?
3 replies · Started by Fredrik on November 1, 2020
Hi,
I noticed that Generatepress adds for example "#more-3741" to my URL's after clicking the "read more" buttons on the archive pages. Is there a way to easily prevent this? Because I just want the clean URL's and not adding more confusion to Google about this.
Thanks.
Hi,
It was added as a jump link to be able to go directly to the content when you click the button.
But you can easily remove the #more-xxxx by adding this PHP:
add_filter( 'generate_more_jump', '__return_false' );
Here's how to add PHP: https://docs.generatepress.com/article/adding-php/
Reference:
https://docs.generatepress.com/article/generate_more_jump/
https://docs.generatepress.com/article/generate_content_more_link_output/
Hmm, I see. Can I add this PHP code using elements > hook and just paste it in there?
Because I don't like the idea of always installing plugins to do simple things like this.
Should be a way to add that line without having to do that. But I need some clear instructions on it.
What is the point of the "jump link". I don't get it. The links on the title and image are linking like I want, while the read more button is adding that strange "#more". Anyway, please tell me how to do this.
Many thanks for your fast response.
You can create a child theme and add the code to the child theme's functions.php if you don't want to use a plugin.
But if you don't want to add a child theme too, you can add the code on your theme's functions.php but it may be removed if you update the theme.
The easiest solution is using Code Snippets plugin. It is pretty lightweight so it shouldn't affect your page speed at all.