WordPress.com Related Posts Is Being Deprecated. Meet Jetpack Related Posts.

Have you encountered this message in your dashboard recently? “WordPress.com Related Posts needs a little extra configuration behind the scenes. Please contact support to make it happen.”

If your VIP site utilizes the WordPress.com Related Posts plugin, we have a few changes for you that we expect to improve the performance of Related Posts.

We’ve deprecated the WordPress.com Related Posts plugin and are focusing our efforts on the Jetpack Related Posts plugin, which is now built into WordPress.com.

What does this mean for you? We have changed the internals of our plugin to use Jetpack Related Posts, so all sites are already using it, but a teensy bit of housekeeping will help us keep things tidy. If you’re not using a custom implementation, all that’s needed is:

  1. Disable the WordPress.com Related Posts plugin
  2. Turn on JP Related Posts in Settings > Reading.
  3. Yup, that’s all there is to it!

If you’re programmatically retrieving posts, the new method is:

$posts = Jetpack_RelatedPosts::init_raw()->get_for_post_id( $post_id, $args );

// Returns an associative array in the form of id => $post_id:
/*
array(
    'id' => 12345,
    'id' => 54321
)
*/

Note: This function returns an associative array, which is different from the behavior of WPCOM_Related_Posts()->get_related_posts(). Code must be updated accordingly.

Note: This function performs an HTTP request to the REST API, so object caching should be added around the results.

Again, our changes to the VIP Related Posts plugin are backwards compatible, but the plugin is now considered deprecated.

If you still have questions, let’s see if we can answer them here – otherwise please feel free to open a ticket in ZenDesk for more info so we can help you navigate through this change.


Q: We’ve customized the display of our related posts to a great degree. Will our existing code just work?

A: We’re mapping the old functions over to the Jetpack ones behind the scenes, but it’s easier and better if you just use the Jetpack functions now.


Q: Our theme is loading the Related Posts plugin via wpcom_vip_load_plugin( ‘wpcom-related-posts’ ); If we remove that, it’ll just work? Will our call to the class/method from that plugin still continue to work as expected?

A: If you’re using the standard implementation (no programmatic access), you’ll just need to enable JP Related Posts at Settings > Reading. Otherwes, because you are calling it manually, you should actually use the Jetpack functions: http://jetpack.me/support/customize-related-posts/


Q: We’ve switched out the the code from the wpcom-related-posts to using Jetpack Related Posts. What’s next?

A: Have you enabled the option in Settings > Reading? If you have then it should just start working for you. If it isn’t, open a ticket in ZenDesk and let us know.


Q: We want related posts to appear in the sidebar instead of content area, using some custom markup/css.

A: You can use this filter to hide the content from the post body: http://jetpack.me/support/customize-related-posts/#disable This will ensure that everything is still indexed and that the related posts list will only display when you explicitly wish it to (e.g. in the sidebar). Then, you’ll need to query the related posts manually, using the JP function mentioned above.


Related links

http://jetpack.me/support/customize-related-posts/