Moves the gallery shortcode styles to the head so it doesn't break XHTML validation; allows disabling or modifying the default gallery styles.
As of April 2026, Gallery Shortcode Style to Head is a WordPress css plugin with 100 active installations and a 5/5 rating from 1 reviews. It has been downloaded 11K+ times in total. Requires WordPress 3.3+ and PHP false+. Available on WordPress.org since 2008. Last updated 11 years ago — may have compatibility concerns. Top alternative: WPCode – Insert Headers and Footers +….
Moves the gallery shortcode styles to the head so it doesn’t break XHTML
validation; allows disabling or modifying the default gallery styles.
By default when using the WordPress gallery, the styles are placed into the
post content which breaks XHTML validation. This plugin moves the style into
the head of the page using a look-ahead to determine if the [gallery]
shortcode is used in any posts.
This plugin also gives you the option to modify the default gallery style
CSS or disable the gallery styles entirely (so you can control it from your
template CSS files).
This plugin uses ideas recommended in a patch located at
https://trac.wordpress.org/attachment/ticket/6380/6380-style.diff
Special thanks to
* The original author: Matt Martz, http://sivel.net
* Serbo-Croatian (sr_RS) transl…
| WordPress | 3.3+ requiredTested up to 4.1.42 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.