This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Widget Attributes


This plugin is intended to be used by theme authors that need to have custom attributes for the widgets so they can define common classes for similar widgets, etc.

When activated, you’ll get two additional input fields in the widget configuration forms, where you can assign a custom ID and classes for the widgets.

Please note that before the attributes are saved, they will be passed through sanitize_html_class() so all blacklisted characters will be stripped.


  • Widget configuration form
  • Widget attributes inserted into the markup


  1. Upload widget-attributes to the /wp-content/plugins/ directory
  2. Go to Plugins and activate Widget Attributes
  3. Go to Appearance > Widgets and add the attributes


Do I need to add code to my theme’s `functions.php` file?

No, you don’t. This plugin just works(TM). However, you will need to add the style for the classes you use for your widgets.

Is there any known bug?

In short, maybe. If your theme or one of your plugins is replacing the default widget callback in a weird way, this plugin may not work.

Do you provide filters?

YES! You can hook into widget_attribute_id and/or widget_attribute_classes if you need to validate/sanitize the attributes provided by the user. For example:

 * Check for widget classes provided by the user
 * @param string $classes Widget class(es), separated by spaces
function my_widget_classes_filter( $classes ) {
    // do your thing...
    return $classes;
add_filter( 'widget_attribute_classes', 'my_widget_classes_filter' );


There are no reviews for this plugin.

Contributors & Developers

“Widget Attributes” is open source software. The following people have contributed to this plugin.


Translate “Widget Attributes” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Update compatibility info



  • Cleanup


  • Initial release