WordPress – Remove next/previous post links

How to remove the WordPress next/previous post links:

function remove_link( $format, $link ) {
    return false;
add_filter( 'previous_post_link', 'remove_link' );
add_filter( 'next_post_link', 'remove_link' );

Add the code above at the end of your functions.php -> Design -> Editor

After a site reload the next and previous post links were gone.

This is a better solution because all of the internet is full of just the css solution to hide it.

The code above removes the links itself and not just hides them, but they are still in the code.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Nach oben scrollen