Title: modify gutenberg sidebar component?
Last modified: April 9, 2023

---

# modify gutenberg sidebar component?

 *  [thomask](https://wordpress.org/support/users/thomask/)
 * (@thomask)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/modify-gutenberg-sidebar-component/)
 * I want to modify post excerpt sidebar component (
   [https://github.com/WordPress/gutenberg/blob/d0fa04737ffda96b03bade9d724bc7fd842482d4/packages/editor/src/components/post-excerpt/index.js](https://github.com/WordPress/gutenberg/blob/d0fa04737ffda96b03bade9d724bc7fd842482d4/packages/editor/src/components/post-excerpt/index.js))
   I was able to modify it by adding javascript to post.php, but the problem is,
   that when you e.g. click the editor, so the sidebar tab switches from post to
   block and then go back to post tab, it is whole reinitialised and all my changes
   are gone. I would need a way, to eithera) modify the component, so that it will
   be always initialized with my changes (or delete this component and setup my 
   version of it) orb) run my modification script when the panel is inicialised

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

 *  [luishporras](https://wordpress.org/support/users/luishporras/)
 * (@luishporras)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/modify-gutenberg-sidebar-component/#post-16641100)
 * Hi!
 * Have you checked the tutorial from the official docs [‘How to use js in the block editor’](https://developer.wordpress.org/block-editor/how-to-guides/javascript/)?
 *  [Daniel Richards](https://wordpress.org/support/users/talldanwp/)
 * (@talldanwp)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/modify-gutenberg-sidebar-component/#post-16654179)
 * I don’t think the excerpt component is something that supports being extended,
   but there are ways to add extend to the post panel:
   [https://developer.wordpress.org/block-editor/reference-guides/slotfills/](https://developer.wordpress.org/block-editor/reference-guides/slotfills/)`
   PluginDocumentSettingPanel` and `PluginPostStatusInfo` are probably the two closest
   points of extensibility.

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

The topic ‘modify gutenberg sidebar component?’ is closed to new replies.

## Tags

 * [component](https://wordpress.org/support/topic-tag/component/)
 * [excerpt](https://wordpress.org/support/topic-tag/excerpt/)
 * [gutenberg](https://wordpress.org/support/topic-tag/gutenberg/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [Daniel Richards](https://wordpress.org/support/users/talldanwp/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/modify-gutenberg-sidebar-component/#post-16654179)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
