Title: Where is the widget code?
Last modified: August 19, 2016

---

# Where is the widget code?

 *  [finofontana](https://wordpress.org/support/users/finofontana/)
 * (@finofontana)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/where-is-the-widget-code/)
 * I am pretty new to WP. I’ve searched the web for an answer to this problem. Couldn’t
   find one. I’m using this dynamic widget thing (Appearance>Widgets) where I can
   drag and drop the widgets. I’d like to change some HTML code in some of these
   widgets, but I cannot find the code which creates these them. It’s not in the
   sidebar.php; this file can be made completely empty and the sidebar and widgets
   still appears. Could someone point me to the place/files where the HTML of the
   dynamic widgets is generated.
    Thanks a lot. Regards. Fino.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [WatchCount.com](https://wordpress.org/support/users/watchcountcom/)
 * (@watchcountcom)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/where-is-the-widget-code/#post-1377041)
 * Depends which widget. You’d need to dig through the plugin’s code.
 * -WCC
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/where-is-the-widget-code/#post-1377053)
 * you’ll find the widget codes in:
    wp-includes/default-widgets.php
 * be aware that changes in these wp core files will be lost when you upgrade to
   a new version.
 *  Thread Starter [finofontana](https://wordpress.org/support/users/finofontana/)
 * (@finofontana)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/where-is-the-widget-code/#post-1377242)
 * Great! Thanks for the hint. Now I’m pondering about the following.
 * I’ve found the code for Recent Comments (default_widgets.php: class WP_Widget_Recent_Comments):
 *  <ul id=”recentcomments”><?php …
 * I’d like to change stuff here. F.e.: maybe I would like to use an
    ol tag instead
   of an ul tag. I could change it in default_widgets.php, but as alchymyth mentioned:
   these changes could be overwritten when upgrading WP. How could I make changes
   which are being kept during an upgrade. Can I do something with functions.php
   for example?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Where is the widget code?’ is closed to new replies.

 * 3 replies
 * 3 participants
 * Last reply from: [finofontana](https://wordpress.org/support/users/finofontana/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/where-is-the-widget-code/#post-1377242)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
