WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a plugin that uses a custom post type. I do not want to make a custom template for viewing the posts and discovered I can add a filter for the_content to include my custom fields, this works great. However, I don't want visitors to navigate the custom post types with the previous next navigation. It there a way to remove these without creating a custom template?

Thank you for taking the time to look at my issue.

share|improve this question
up vote 1 down vote accepted

Try this:

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

It should work if the theme uses next_post_link() and previous_post_link().


share|improve this answer
Darko, Thank you, looks like your memory is a was a little hazy but I was able to sort it out. Here's what I wound up with and it's seams to solve my issue. (Can't figure out how to enter returns in comments, sorry for the lack of formatting...): function remove_link( $format ) { return false; } add_filter( 'previous_post_link', 'remove_link' ); add_filter( 'next_post_link', 'remove_link' ); – Jason M Jan 30 '13 at 17:44
Oh oh, sorry about that! Will fix it, but glad you got it working. – Darko Stanimirović Feb 1 '13 at 20:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.