Get Recent Posts by Date in Multisite

Since wordpress multisite uses different tables for all blogs, it is very inefficient to get all recent articles of all blogs (content aggregation) on display time since you have to query all blogs, sort the articles by date and display the ammount you need.

Plugins like WordPress Post Indexer (https://premium.wpmudev.org/project/post-indexer) additional write all posts into one central db table in the moment you insert or update them. From there, you can query them very efficiently.

I used the mentioned plugin by myself – its worth to try.
I’m not associated with the creator.

There are some things to consider too: For example: if you want display custom post meta fields, you’ll have to use switch_to_blog.

Leave a Comment