Title: Widget blocks
Last modified: February 5, 2025

---

# Widget blocks

 *  Resolved [franklnx](https://wordpress.org/support/users/franklnx/)
 * (@franklnx)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/)
 * Hello,
   after verifying that the plugin is working properly with respect to the
   blocks inserted in the pages, I noticed that the attributes cannot be inserted
   in the widget area blocks.Unfortunately, this is exactly what I was looking for:
   inserting aria-labels in the sidebar blocks to make the site more accessible.
   I read the plugin’s documentation but couldn’t find any references. Is there 
   a restriction on the widget area blocks?
 * Regards,

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

 *  [websevendev](https://wordpress.org/support/users/websevendev/)
 * (@websevendev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18287979)
 * Looks like it’s a bug.
 * The reason you can’t add attributes in the Widget editor is because when the 
   plugin is checking for `wp.data.select('core/editor').canUserUseUnfilteredHTML()`
   it returns `false` even though your user probably can use unfiltered HTML.
 * Since this restriction is only client-side, as a workaround you can paste this
   code into the JavaScript console (F12 -> Console) and then you should be able
   to add attributes (may need to unselect and reselect the block so that it re-
   renders first):
 *     ```wp-block-code
       wp.data.select('core/editor').canUserUseUnfilteredHTML = () => true
       ```
   
 * The workaround will stop working after you reload the page, but if your user 
   does in fact have `unfiltered_html` capability then the attributes will persist
   and you can use the workaround again to edit them later.
 *  Thread Starter [franklnx](https://wordpress.org/support/users/franklnx/)
 * (@franklnx)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18288398)
 * Thank you for the quick response.
   The proposed solution makes the plugin usable
   in the widget area however it makes the work slightly longer. I was wondering:
   what do you mean by “bug” and “client-side restriction”? Basically what I would
   like to understand is if the proposed solution will always be needed, even in
   the future, or if there is hope for a permanent fix.
 * Thank you very much for your support. Regards,
 *  [websevendev](https://wordpress.org/support/users/websevendev/)
 * (@websevendev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18288473)
 * > if the proposed solution will always be needed, even in the future, or if there
   > is hope for a permanent fix
 * The block editor team are in the process of unifying all the editors, so I would
   assume that it will start working eventually. Currently the editor is using the
   setting `__experimentalCanUserUseUnfilteredHTML` for determining this permission,
   so I will leave it for now, but once it is no longer experimental and still doesn’t
   work I’ll see if anything can be done on the plugin side.
 *  Thread Starter [franklnx](https://wordpress.org/support/users/franklnx/)
 * (@franklnx)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18288623)
 * Thank you, it is clear to me.
   However, despite the workaround and the ability
   to put attributes in the widget blocks, they do not appear in the html code.I
   tested the plugin with the page blocks and the attributes are inserted in the
   code, but this does not happen in the sidebar.Obviously after each modification
   I clear each cache. But there still seems to be a problem on the widget blocks.
   I will keep testing….
 * Regards
 *  Thread Starter [franklnx](https://wordpress.org/support/users/franklnx/)
 * (@franklnx)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18288945)
 * Resolved (Attributes are present in the html code. Probably a caching problem).
 *  [kamaldev](https://wordpress.org/support/users/kamaldev/)
 * (@kamaldev)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18308435)
 * I had use your plugin Attribute for Block . Its working perfect . But i want 
   to add attributes on table thead tbody tr td element how can i do this

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

The topic ‘Widget blocks’ is closed to new replies.

 * ![](https://ps.w.org/attributes-for-blocks/assets/icon-256x256.png?rev=2588242)
 * [Attributes for Blocks](https://wordpress.org/plugins/attributes-for-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/attributes-for-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/attributes-for-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/attributes-for-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/attributes-for-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/attributes-for-blocks/reviews/)

## Tags

 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 6 replies
 * 3 participants
 * Last reply from: [kamaldev](https://wordpress.org/support/users/kamaldev/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/widget-blocks-2/#post-18308435)
 * Status: resolved