How do I sort WordPress posts by most popular?

Tips and tricks from Tamara Olson Designs

WP PostViews, said everyone — except it was blocked on WPEngine.

The answer? Post Views Counter and this little addition to my query:


$args=array(
'posts_per_page' => -1,
'post_status' => 'publish',
'order' => 'DESC',
'orderby' => 'post_views',
'suppress_filters' => false
);
query_posts($args);


Share Your Thoughts

About the Author

TamaraAuthorPhoto

Tamara Olson is a self-employed UX designer and WordPress developer living in New York City.

Tamara Olson Designs Case Studies