WP Most Popular was born out of frustration in finding a decent plugin which performs one simple task and that is to rank your most popular blog posts.
The plugin keeps a log of your most popular posts based on views and lets you display them in your blog theme with custom styling. You can display popular posts from the last day, 7 days, 30 days or all time.
It also comes with a sidebar widget to let you display your popular posts on your blogs sidebar.
If you are a developer and integrate the plugin in to a theme, you will get a lot more flexibility out of the plugin including the ability to show the most popular custom post types etc.
There are two ways in which you can use this plugin.
- As a sidebar widget
- Custom function in your theme files
Using the widget is the easiest way and recommended for most users. If you are a developer and want to integrate the plugin in to your existing theme, then read the information below.
Firstly, the main function which you will need to include in your theme to fetch the popular posts is called
You can pass that function the following parameters in array form:
- limit (integer)
- The number of posts you would like to display i.e. 5
- Default: 5
- post_type (string) / (array)
- The post type you would like to display
- Example: post
- Default: All post types
- range (string)
- In what date range would you like to display popular posts in
- Accepted: all_time, monthly, weekly, daily
- Default: all_time
Those are the current parameters that the plugin supports. Let’s look at an example of how to display the most recent popular posts in a unordered list.
<?php echo '<ul>'; $posts = wp_most_popular_get_popular( array( 'limit' => 10, 'post_type' => 'post', 'range' => 'all_time' ) ); global $post; if ( count( $posts ) > 0 ): foreach ( $posts as $post ): setup_postdata( $post ); ?> <li><a href="<?php the_permalink() ?>" title="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></li> <?php endforeach; endif; echo '</ul>'; ?>
The following filters are available to you:
- wp_most_popular_list_before – used to filter the
- element of the outputted widget list
* **wp_most_popular_list_after** – used to filter the
element of the outputted widget list
* wp_most_popular_list_item_single – filters for a the list item generated by the widget
- wp_most_popular_list_item – used for modifying the list output
Setting up WP Most Popular is very simple. Follow these easy steps
- Upload the plugin to your
- Activate the plugin in your WordPress admin
- Add sidebar widget or integrate functions in to your theme
- Why are no posts displaying when I use the widget or call the function in my theme?
99% of the time this is because no posts have been visited yet to receive a ranking. Simply click on a blog post to read it on your blog and it will receive a ranking and display in the list of most popular posts.
- What are the minimum requirements for the plugin?
- Can I request a feature?
Yes, please do so on the WordPress support forum for the plugin. I will consider it and if I feel it is worth adding, I will schedule it for a future release.
- Can I contribute code to the plugin?
Yes! The plugin is open source and I host it on Github. Feel free to send me pull requests.
I hope you are doing well !!!
I have installed this Wp most popular plugin in my website, my website is on wp-engine server. so server person giving max hitting creating under this plugin code. so please check this plugin code. i have some response from wp-engine support so please guide me how to resolve this issue.
ack-grep “wmp_update” plugins/ themes/
65: add_action( ‘wp_ajax_wmp_update’, ‘WMP_system::actions’ );
67: add_action( ‘wp_ajax_nopriv_wmp_update’, ‘WMP_system::actions’ )
I am waiting your response!!!
Great plugin, can be called with a function to show popular posts anywhere.
I was able to create a category for popular posts and then call the plugin function when that category was viewed.
However, only giving it 4 stars as I’ve realised that when the plugin is deactivated, all the database info is deleted, the whole table for this plugin is gone!
This should only happen when the plugin is deleted, not deactivated.. Deactivation should be viewed as a temporary thing, possibly while testing another plugin, it shouldn’t remove all the data!
If this is fixed it would be worthy of 5 stars.
Simple and elegant: does show the most popular posts, nicely in the theme styling.
Like this plugin, simple, effective.
I would also would have liked to place a shortcode (not filecode) onto a page which would allow to show op/popular listings for each category.
I’ll favourite this for now until such is added.
Contributors & Developers
“WP Most Popular” is open source software. The following people have contributed to this plugin.Contributors
- Fixed a bug where the old function
wmp_get_popularwas no longer working as it should for backwards compatibility
- New helper function name for getting the most popular posts
wp_most_popular_get_popular. Please note that the old function name is still supported
- New filters and action introduced for use on widget (wp_most_popular_list_before, wp_most_popular_list_after, wp_most_popular_list_item, wp_most_popular_list_item_single) (thanks to sanchothefat and callerc1)
- Widget now supports thumbnails (thanks to eduardo-marcolino)
- Added a CSS class name to the widget list (thanks to sinisterstuf)
- Fixed a bug where the plugin was using a deprecated function (since version 4.3) to setup the widget
- Added the ability to query multiple different post types (thanks inc2734)
- You can now also choose a specific post type from the widget
- First version of the plugin released