How to: Move Jetpack’s Related Posts Module

Jetpack’s Related Posts module currently doesn’t come with any settings allowing you to control where it is placed. Activate it, and you will get three suggested posts in a row directly at the bottom of your content, underneath the Jetpack sharing icons (if you’ve got them enabled – see below). To move them here’s what you need to do:

Stop related posts appearing automatically…

… by adding this snippet of code to the functions.php file in your theme

function jp_remove_related() {
	$jprp = Jetpack_RelatedPosts::init();
	$callback = array( $jprp, 'filter_add_target_to_dom' );
	remove_filter( 'the_content', $callback, 40 );

add_filter('wp', 'jp_remove_related', 20);

And then either:

Use a shortcode in individual posts


Call the shortcode in your theme

A much better solution if you want to call it outside of the content area consistently on every single post page.

Leave a Reply

Brilliant website with a huge volume of material made accessible. Really effective and easy to use. Can’t recommend you highly enough.

Marie Wright (OXDOX)