Using WordPress ‘get_most_active_blogs()’ PHP function

The get_most_active_blogs() WordPress PHP function retrieves a list of the most active sites. This function is deprecated.

Usage

get_most_active_blogs( $num, $display );

Example:

get_most_active_blogs( 5, true );

This example retrieves the 5 most active blogs and displays the list.

Parameters

  • $num int (Optional) – Number of active blogs to retrieve. Default: 10
  • $display bool (Optional) – Whether or not to display the most active blogs list. Default: true

More information

See WordPress Developer Resources: get_most_active_blogs()

This function is deprecated, and you should avoid using it in new projects.

Examples

Get Top 3 Active Blogs

Retrieve the top 3 most active blogs.

get_most_active_blogs(3);

Get Top 5 Active Blogs Without Displaying

Retrieve the top 5 most active blogs without displaying the list.

get_most_active_blogs(5, false);

Get Default Number of Active Blogs

Retrieve the default number of active blogs (10) and display the list.

get_most_active_blogs();

Get Top 7 Active Blogs

Retrieve the top 7 most active blogs and display the list.

get_most_active_blogs(7);

Get Top 20 Active Blogs Without Displaying

Retrieve the top 20 most active blogs without displaying the list.

get_most_active_blogs(20, false);