Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Clean header

  • Dear support team,

    I’m trying to remove unnecessary code from the header. Unfortunately, it’s not working right now. Can you help me?

    I want to remove the following content from the header:

    – <style>img:is([sizes=”auto” i], [sizes^=”auto,” i]) { contain-intrinsic-size: 3000px 1500px }</style>
    – <style id=”classic-theme-styles-inline-css”> … </style>
    – <style id=”generate-navigation-branding-inline-css”> … </style>
    – <meta name=”msapplication-TileImage” content=”/wp-content/uploads/favicon-300×300.png”>

    In the content code I would also like to remove the Javascript.
    – <script id=”generate-a11y”> … </scripts>

    I removed everything with the developer tool and it seems like I don’t need this information.

    Kind regards
    Jens

  • Hi there,

    Those style sheets come with each plugin and theme, you can NOT delete those easily.

    For example, classic-theme-styles-inline-css is from WP, if you want to remove it, you need this PHP code:

    add_action( 'wp_enqueue_scripts', function() {
        wp_dequeue_style( 'classic-theme-styles-inline-css' );
    }, 20 );

    For the GP ones, you can disable unused premium modules at appearance > generatepress to stop them generates styles.

    Others might from other plugins that I’m not aware of, so you might need to check with other plugins’s support.

  • Hi Ying,

    I had already tried the code in the function.php. Unfortunately, it doesn’t work.
    The code is still included.

    Kind regards
    Jens

  • In that case, you might need to check with WP’s support, as it’s from WP.

  • Hi Ying,

    Can you please check if this still works for you?

    Kind regards
    Jens

  • No, the code doesn’t work.

    So please check with WP on how to disable that stylesheet 🙂

    Sometimes cache plugin also has the option to disable certain stylesheets, worth a look.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.