Title: Remove default widget markup
Last modified: December 11, 2019

---

# Remove default widget markup

 *  Resolved [Klecka](https://wordpress.org/support/users/klecka/)
 * (@klecka)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/remove-default-widget-markup/)
 * My sidebar is called this way in my theme
 *     ```
       <div class="block">
         <?php dynamic_sidebar( 'sidebar-footer-1' ); ?>
       </div>
       ```
   
 * When I visit the website, the code shows
 *     ```
       <div class="block">
         <li id="text-4" class="widget widget_text">
           <div class="textwidget">
             ...
           </div>
         </li>
       </div>
       ```
   
 * How do I get rid of the markup inside the .block-element?
    In the registration
   in my functions the args are empty:
 *     ```
       'before-widget' => 	'',
       'after-widget' => 	'',
       'class' =>		'',
       ```
   
    -  This topic was modified 6 years, 6 months ago by [Klecka](https://wordpress.org/support/users/klecka/).

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/remove-default-widget-markup/#post-12225046)
 * It’s part of the default text widget output. You’d need to extend the widget’s
   class with a new name and override the appropriate method with your own version
   that does not produce the undesired output. Then use your version instead of 
   the text widget in your widget area.
 * To what end? With appropriate CSS the markup would have no effect.
 *  [Youssef Mhamdi](https://wordpress.org/support/users/blackcat13007/)
 * (@blackcat13007)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/remove-default-widget-markup/#post-12225076)
 * Hello [@klecka](https://wordpress.org/support/users/klecka/) !
 * I hope you are doing well today!
 * I checked your code and it’s looks like you wrote it in a wrong syntax.
 * Please note that:
    `'before-widget'` & `'after-widget'` Must Written with UNDERSCORE(_).`'
   before_widget'` & `'after_widget'`
 * This is the default WP Sidebar registration
 *     ```
       <?php $args = array(
       	'name'          => __('Sidebar %d'),
               'id'            => 'sidebar',          
       	'description'   => '',
       	'class'         => '',
       	'before_widget' => '<li id="%1$s" class="widget %2$s">',
       	'after_widget'  => '</li>',
       	'before_title'  => '<h2 class="widgettitle">',
       	'after_title'   => '</h2>' ); 
       ?>
       ```
   
 * Best Regards,
    Youssef
 *  Thread Starter [Klecka](https://wordpress.org/support/users/klecka/)
 * (@klecka)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/remove-default-widget-markup/#post-12225144)
 * Hey [@blackcat13007](https://wordpress.org/support/users/blackcat13007/), yah,
   now I’m doing well. It was that typo. Thank you so much, I thought I was going
   crazy.

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

The topic ‘Remove default widget markup’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Klecka](https://wordpress.org/support/users/klecka/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/remove-default-widget-markup/#post-12225144)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
