Title: Files added before doctype declaration, breaks other plugin functionality
Last modified: August 30, 2016

---

# Files added before doctype declaration, breaks other plugin functionality

 *  [Erica Franz](https://wordpress.org/support/users/ericakfranz/)
 * (@ericakfranz)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/)
 * I’m seeing this issue fairly often on customer’s sites I’m helping troubleshoot—
   the minify file is added before the doctype declaration which can break functionality
   in other plugins.
 * Someone else raised the issue at [https://wordpress.org/support/topic/minified-css-and-js-files-above-the-doctype?replies=1](https://wordpress.org/support/topic/minified-css-and-js-files-above-the-doctype?replies=1)
   but the topic was closed without further comment. I’d like to re-open and request
   you investigate further.
 * Thanks!
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

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

 *  [TwoBrands BV](https://wordpress.org/support/users/webworkx/)
 * (@webworkx)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582081)
 * Today i also encountered this problem, all minified css is before the doctype
   declaration.
 * This is no valid html and causes problems.
 * Anybody wo had this problem or solved it in the meantime?
 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582082)
 * fascinating why it would do that. I have some hypotheses on how that might happen.
   But for the sake of time (to get your site working)…can you add the following
   directive wherever you like within your **header.php **file (obviously anywhere
   after the `<head>` open tag):
 *     ```
       <!-- W3TC-include-css -->
       ```
   
 * See if that fixes things 🙂
    I feel sorry for Erica (the OP) seeing as how she
   posted her similar problem 2 months ago and no one responded.
 * Cheers
    Kimberly
 *  [TwoBrands BV](https://wordpress.org/support/users/webworkx/)
 * (@webworkx)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582083)
 * Thanks Kimberly, this seems to work.
    the minified css is inserted right at the
   place of the tag in the header.php.
 * Any idea what causes this effect? I manage 30+ wordpress websites and never saw
   this before.
 * Thanks!
 *  [AJD](https://wordpress.org/support/users/ajd/)
 * (@ajd)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582099)
 * I am seeing this same issue. The minified style-sheet is inserted before the !
   DOCTYPE tag, creating invalid html…
 * The suggested fix did work, thanks!
 * AND this seems like something that shouldn’t need to be manually fixed…
 *  Thread Starter [Erica Franz](https://wordpress.org/support/users/ericakfranz/)
 * (@ericakfranz)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582106)
 * This issue is still ongoing.
 * Thanks to Kimberly for the hack to work-around the issue.
 * I’d still like to see W3TC fix this bug on their end so users don’t need to hack
   their theme’s template files. 🙂

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

The topic ‘Files added before doctype declaration, breaks other plugin functionality’
is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

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

 * 5 replies
 * 4 participants
 * Last reply from: [Erica Franz](https://wordpress.org/support/users/ericakfranz/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/files-added-before-doctype-declaration-breaks-other-plugin-functionality/#post-6582106)
 * Status: not resolved