WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i would like to find the source code of the widgets, would you know where to find them? I found the class WP_Widget, but i would like to find, for example, the widget with the last articles.


share|improve this question
up vote 3 down vote accepted

The default widgets are defined in wp-includes/default-widgets.php.

To find specific code search the Codex or use queryposts.com. The best tool is your IDE (integrated development environment). All IDEs offer a full text search in a set of files.

Here a screen shot from Eclipse PDT

enter image description here

As you can see it is really flexible – and it's fast too. See also this question for a basic guide on how to work with WordPress in an IDE.

share|improve this answer
another link to find the source code of WordPress functions: phpxref.ftwr.co.uk/wordpress/nav.html?_functions/index.html – Michael May 18 '12 at 9:33
@Michael Thanks ! – Paul May 18 '12 at 10:15
@toscho : Thanks ! – Paul May 18 '12 at 10:15

Widgets can come from any number of sources: plugins, themes, or the core itself. As such, finding the code for a specific widget could prove troublesome if you do not know it's origin. You could grep for it using bits you know, or grep for all widgets using extends WP_Widget. If you know where it comes from (core, plugin, etc) it's a simple matter of thumbing (or greping, I suppose) through code.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.