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 want to rename "Widget" to something else

Like "Block" or something else.

please help me.


Per the user's comment below, she wants to change class="widget" to class="block" (or any arbitrary class name) in the rendered, sidebar Widget.

share|improve this question
We need considerably more information, if we are to hope to help you here... – Chip Bennett Oct 25 '11 at 14:53
want to rename "class="widget" to class="Block" in sidebar – user8503 Oct 25 '11 at 14:58
up vote 1 down vote accepted

The classes assigned to rendered Widgets are specified by the argument array passed to the register_sidebar() call used to register the sidebar. e.g.:

    $args = array(
        'name'          => sprintf(__('Sidebar %d'), $i ),
        'id'            => 'sidebar-$i',
        'description'   => '',
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>' ); 

See the before_widget parameter:

'before_widget' => '<li id="%1$s" class="widget %2$s">'

...change it accordingly, e.g. to:

'before_widget' => '<li id="%1$s" class="block %2$s">'
share|improve this answer
thanks a lot Chip Bennett – user8503 Oct 25 '11 at 15:09

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.