Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get usernumposts

This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.


Returns the post count for the user whose ID is passed to it. Properties map directly to the wp_posts table in the database (see Database Description).

Replace With



 <?php get_usernumposts(userid); ?> 


(integer) (required) The ID of the user whose post count should be retrieved.
Default: None


Default Usage

The call to get_usernumposts returns the number of posts made by the user.

<?php echo 'Posts made: ' . get_usernumposts(1); ?>

Posts made: 143

Change Log

  • Since: 0.71
  • Deprecated: 3.0.0

Source File

get usernumposts() is located in wp-includes/deprecated.php. Formerly, wp-includes/user.php.


See also index of Function Reference and index of Template Tags.