[Support request] Why do Generatepress add “#more-3741” to url’s with the read more buttons?

Home Forums Support Why do Generatepress add “#more-3741” to url’s with the read more buttons?

  • This topic has 3 replies, 2 voices, and was last updated 4 months ago by Elvin.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1513723
    Fredrik

    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.

    #1513744
    Elvin
    Staff
    Customer Support

    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/

    A wise man once said:
    "Have you cleared your cache?"

    #1513755
    Fredrik

    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.

    #1513761
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.