Laura asked: “How to get words count of your post?”

DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

One of our readers, Laura, asked in the forum how to get and display the word count of a post. In fact, there is a plugin to do that, but I never heard about a code snippet. So here is a recipe to fit Laura’s needs.

The first thing to do is to create the function. Paste the following code on your functions.php file: