Title: Remove extra code not needed in block editor
Last modified: August 6, 2024

---

# Remove extra code not needed in block editor

 *  Resolved [joycegrace](https://wordpress.org/support/users/joycegrace/)
 * (@joycegrace)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/)
 * Hello, this plugin is adding a whole bunch of extra code into the HTML of Block
   Editor pages.
 * It is adding its options to every single block. But the settings are not being
   used at all for these blocks.
 * This is making is very difficult to locate elements in the code editor of a page.
 * It is also making things ‘messy’.
 * To give just a glimpse (sine I can’t add screenshots here), one block has the
   following bits of code in it:
 *     ```wp-block-code
       "extended_widget_opts": {"id_base":-1, "column":{"desktop": "12", "tablet": "12", "mobile":"12"},"alignment" :{"desktop": "default", "tablet": "default", "mobile": "default"}, "roles":{"state":"'","options":"hide"}, "visibility":{"selected":"0", "options": "hide", "acf":{"visibility":"hide", "field":"'', "condition":''', "value":"'}},"author_page" :{"author_pages":{"selections": "1"}}, "devices" :{"options": "hide"}, "days":{"options": "hide"}, "dates":{"options": "hide", "from":"''',"to":"'},"styling" :
       ```
   
 * And it goes on and on…
    - Is there a way to prevent this code from being added to widgets that are not
      using any widget options?
    - Is there a way to add only the code pieces necessary for any particular widget
      option being applied to a block?
    - How do we remove all the extra code after deactivating the widget options 
      plugin, without having to re-format every single block on all of our pages?
 * Thank you

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

 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-17942738)
 * Hi [@joycegrace](https://wordpress.org/support/users/joycegrace/),
 * Thanks for reaching out. We have now relayed this to our development team for
   further verification. We’ll keep you posted!
 * Regards,
   Mej, from Widget Options team
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-17956392)
 * Hi [@joycegrace](https://wordpress.org/support/users/joycegrace/),
 * According to our developer, these codes cannot be removed as they are essential
   for ensuring that other widgets function correctly with the widget options in
   Gutenberg.
 * Thanks and let us know if you have other questions.
 * Regards,
   Mej, from Widget Options team
 *  Thread Starter [joycegrace](https://wordpress.org/support/users/joycegrace/)
 * (@joycegrace)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-18018607)
 * Why can’t you just remove the code that is not being used for a particular widget?
   What would one widget’s code have to do with another widget’s code?
 * Can you also please answer this question from the original post:
 * How do we remove all the extra code after deactivating the widget options plugin,
   without having to re-format every single block on all of our pages?
    -  This reply was modified 1 year, 8 months ago by [joycegrace](https://wordpress.org/support/users/joycegrace/).
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-18019341)
 * Hi [@joycegrace](https://wordpress.org/support/users/joycegrace/),
 * Our development team is currently in process of creating a solution on how to
   remove the extra codes when the Widget Options plugin is deactivated.
 * We appreciate your patience and we’ll keep you posted about this.
 * Kind Regards,
   Mej, from the Widget Options Team
 *  Plugin Author [Mej de Castro](https://wordpress.org/support/users/mej/)
 * (@mej)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-18149611)
 * Hi [@joycegrace](https://wordpress.org/support/users/joycegrace/),
 * We recently released a new version of Widget Options. Have you updated the plugin
   yet?
 * We strongly recommend updating to the latest version, as it includes a patch 
   for removing the redundant code not required by the block editor
 * Thank you, and we’d appreciate your feedback on this update!
 * Kind Regards,
   Mej, Widget Options Team
 *  [Lauren](https://wordpress.org/support/users/oncecoupled/)
 * (@oncecoupled)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-18183069)
 * [@mej](https://wordpress.org/support/users/mej/) how does the removal work? Does
   it happen on post save, for example?

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

The topic ‘Remove extra code not needed in block editor’ is closed to new replies.

 * ![](https://ps.w.org/widget-options/assets/icon-256x256.gif?rev=2513739)
 * [Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets](https://wordpress.org/plugins/widget-options/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/widget-options/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/widget-options/)
 * [Active Topics](https://wordpress.org/support/plugin/widget-options/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/widget-options/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/widget-options/reviews/)

## Tags

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

 * 8 replies
 * 3 participants
 * Last reply from: [Lauren](https://wordpress.org/support/users/oncecoupled/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/remove-extra-code-not-needed-in-block-editor/#post-18183069)
 * Status: resolved