diff --git a/src/extensions/site-content/index.js b/src/extensions/site-content/index.js index abb2f8524e5..ea48e043f06 100644 --- a/src/extensions/site-content/index.js +++ b/src/extensions/site-content/index.js @@ -74,10 +74,12 @@ registerPlugin( PLUGIN_NAME, { icon, render: compose( [ ifCondition( () => { + // Prevent Site Content from loading outside of post-new.php pages. + const isPostEditor = window.location.pathname.includes( 'post-new.php' ); const [ siteContentEnabled ] = useEntityProp( 'root', 'site', SITE_CONTENT_FEATURE_ENABLED_KEY ); // In the context of `widgets.php` site content is incompatible due to missing dependencies. const isCompatible = !! selectWithoutHooks( 'core/editor' ); - return siteContentEnabled && isCompatible; + return isPostEditor && siteContentEnabled && isCompatible; } ), withSelect( ( select ) => { const {