How to remove #more tag in WordPress


By default WordPress post listing will embed with #more tag. If you do not like the #more tag like me, you can remove the #more tag using wordpress filter. In case you do not know what is #more tag, here’s the explanation. Whenever user click on the “read more” link at the post listing, it will redirect user to the single post page and auto focus on the anchor tag. I dun find this very useful but caused of confusion to my readers.

To remove the #more in WordPress listing, follow the steps below:-

Advertisements

  • Login to your wordpress
  • Go to Appearance -> Editor
  • Click on functions.php at the right sidebar
  • Copy and paste the code below, and click “Update File”
    function remove_more_jump_link($link) { 
    	$offset = strpos($link, '#more-');
    	if ($offset) {
    		$end = strpos($link, '"',$offset);
    	}
    	if ($end) {
    		$link = substr_replace($link, '', $offset, $end-$offset);
    	}
    	return $link;
    }
    
    add_filter('the_content_more_link', 'remove_more_jump_link');
    
  • Now the #more jump at the post listing should have removed

Credit: Codex




Share this with your friends:-

17 Responses to “How to remove #more tag in WordPress”

  1. ekrem says:

    Thanks from Turkey πŸ™‚

  2. jao says:

    this is very useful. it worked for me. God bless all

  3. Matthew Fries says:

    Exactly what I needed. Simple and effective. Thanks for sharing!

  4. Paulo Figueiredo says:

    Useful!
    tnks
    merry christmas

  5. chua says:

    hi Inxxu, if you didnt see any functions.php file, you may create one and insert the code and it should work.
    sometimes some template do not have this functions.php file, you can just create yours.
    hope this helps

  6. Inxxu says:

    hello there πŸ™‚

    Well, I have tried all sort of things and mostly because no one says “where” in the function.php file I can put this code exactly ..I have tried to put it every possible place, but nothing… Can anyone of you tell me that specific place… ???

    I use Filezilla to view and edit my WP blog.. there I can find that function.php file, but when I go WP administration–>appearance–> editor, then there are no such file as function.php

    As I am new to programming language, I hope that you all don´t mind me asking such question.. :$.. I really do hope that someone of you can help me, because I have wasted 3 days to solve this problem… huh πŸ™‚

    Regards,
    Inxxu

  7. Hamed says:

    and don’t forget to place that’s all

  8. Hamed says:

    It’s Work Great Thanks .

  9. Sergiu says:

    you forgot opening and closing. Dave, this will fix the problem, as I had same problem as you.

  10. chua says:

    hi Dave, in your function file, it should be start with <?php in line 1
    else it will show your error

  11. Dave says:

    My site just screwed up after updating the functions file with the above code. It’s giving the following error Warning: Cannot modify header information – headers already sent by (output started at (url)

  12. El Rico says:

    Thanks! Thanks! Thanks!

  13. Hasani says:

    thanks, I was looking for this for a minute

  14. Cassius Krendler says:

    Nope, doesn’t work for me neither.

  15. Ivan says:

    Great solution! It works perfect! I think sometimes people forget to make correct file permisions before edit files.

  16. kuraikyo says:

    it doesnt work for me >_<

  17. Chris says:

    I love you dude, that was perfect πŸ™‚

Leave a Reply