SG Optimizer


This plugin is designed to link WordPress with the SiteGround Performance services. It WILL NOT WORK on another hosting provider.

The SG Optimizer plugin has few different parts handling speciffic performance optimizations:


For detailed information on our plugin and how it works, please check out our SG Optimizer Tutorial.

SuperCacher Settings

In this tab, you can configure your Dynamic Caching and Memcached. Make sure you’ve enabled them from your cPanel before using the plugin. You can enable/disable the automatic cache purge, exclude URLs from the cache and test your pages if they are properly cached.

Environment Optimization

Here, you can force HTTPS for your site, switch between different PHP Versions (compatibility check available), and enable or disable Gzip Compression and Borwser Caching rules for your site.

Frontend Optimization

In this tab, you can enable or disable Minification of your HTML, JS and CSS resources, remove the Emoji support and remove the query strings from your static resources.

Image Optimization

Here, you can enable or disable optimization for your newly uploaded images, bulk optimize your old ones and enable lazy loading for your site images.

Plugin Compatibility

If your plugin does not trigger standard WordPress hooks or you need us to purge the cache, you can use this public function in your code:

if (function_exists('sg_cachepress_purge_cache')) {

Preferrably, you can pass an URL to the function to clear the cache just for it instead of purging the entire cache. For example:

if (function_exists('sg_cachepress_purge_cache')) {

You can exclude styles from being combined and minified using the filters we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_css_combine_exclude', 'css_combine_exclude' );
function css_combine_exclude( $exclude_list ) {
    // Add the style handle to exclude list.
    $exclude_list[] = 'style-handle';
    $exclude_list[] = 'style-handle-2';

    return $exclude_list;

add_filter( 'sgo_css_minify_exclude', 'css_minify_exclude' );
function css_minify_exclude( $exclude_list ) {
    // Add the style handle to exclude list.
    $exclude_list[] = 'style-handle';
    $exclude_list[] = 'style-handle-2';

    return $exclude_list;

You can exclude script from being minified using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
function js_minify_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';

    return $exclude_list;

You can exclude script from being loaded asynchronous using the filter we’ve designed for that purpose. Here’s an example of the code, you can add to your functions.php file:

add_filter( 'sgo_js_async_exclude', 'js_async_exclude' );
function js_async_exclude( $exclude_list ) {
    $exclude_list[] = 'script-handle';
    $exclude_list[] = 'script-handle-2';

    return $exclude_list;

You can exclude url or url that contain specific query param using the following filters:

add_filter( 'sgo_html_minify_exclude_params', 'html_minify_exclude_params' );
function html_minify_exclude_params( $exclude_params ) {
    // Add the query params that you want to exclude.
    $exclude_params[] = 'test';

    return $exclude_params;

add_filter( 'sgo_html_minify_exclude_urls', 'html_minify_exclude' );
function html_minify_exclude( $exclude_urls ) {
    // Add the url that you want to exclude.
    $exclude_urls[] = '';

    return $exclude_urls;

You can exclude images from Lazy Load using the following filter:

add_filter( 'sgo_lazy_load_exclude_classes', 'exclude_images_with_specific_class' );
function exclude_images_with_specific_class( $classes ) {
    // Add the class name that you want to exclude from lazy load.
    $classes[] = 'test-class';

    return $classes;

WP-CLI Support

In version 5.0 we’ve added full WP-CLI support for all plugin options and functionalities.

  • wp sg purge (url) – purges the entire cache or if URL is passed
  • wp sg memcached enable|disable – enables or disables Memcached
  • wp sg forcehttps enable|disable – enables or disables HTTPS for your site
  • wp sg phpver check (–version=) – checks your site for compatibility with PHP 7.1 or the version you specify
  • wp sg optimize – enables or disables different optimization options for your site:
  • wp sg optimize html enable|disable – enables or disables HTML minification
  • wp sg optimize js enable|disable – enables or disables JS minification
  • wp sg optimize css enable|disable – enables or disables CSS minification
  • wp sg optimize querystring enable|disable – enables or disables query strings removal
  • wp sg optimize emojis enable|disable – enables or disables stripping of the Emoji scripts
  • wp sg optimize images enable|disable – enables or disables New image optimization
  • wp sg optimize lazyload enable|disable – enables or disables Lazy loading of images
  • wp sg optimize gzip enable|disable – enables or disables Gzip compression for your site
  • wp sg optimize browsercache enable|disable – enables or disables Browser caching rules
  • wp sg status dynamic-cache|autoflush-cache|mobile-cache|html|js|js-async|css|combine-css|querystring|emojis|images|lazyload_images|lazyload_gravatars|lazyload_thumbnails|lazyload_responsive|lazyload_textwidgets|gzip|browser-caching|memcache|ssl|ssl-fix|autoflush|dynamic-cache – returns optimization current status (enabled|disabled)


Para que funcione correctamente este plugin requiere que tu servidor reúna los siguientes requisitos:

  • Cuenta en SiteGround
  • WordPress 4.7
  • PHP 5.5
  • Si no estás alojado en SiteGround puede no funcione este plugin ya que requiere una configuración específica del servidor

Our plugin uses a cookie in order to function properly. It does not store personal data and is used solely for the needs of our caching system.


  • The Super Cacher Settings tab handles your Dynamic caching and Memcached. Here, you can exclude URls from the cache, test your site and purge the Dynamic caching manually.
  • In the Environment Optimization tab, you can force HTTPS for your site, switch PHP versions and enable Gzip and Browser Caching rules.
  • The Frontend Optimization tab allows you to Minify HTML, CSS & JS, as well as to remove query strings from your static resources and disable the Emoji support.
  • The Image Optimization tab allows you to optimize your Media Library images, aswell as adds Lazy Loading functionality for your site.
  • Multisite Only! In the Global Settings tab, you can configure all options that are global for your network.
  • Multisite Only! In the Per Site Defaults tab, you can configure how the new sites, added to your network will be setup.


Instalación automática

  1. Ve a Plugins -> Añadir nuevo
  2. Busca por “SG CachePress”
  3. Haz click en el botón de instalar bajo el plugin SG CachePress
  4. Una vez esté instalado el plugin haz click en el enlace de Activar plugin

Instalación manual

  1. Accede a la administración de WordPress y ve a Plugins -> Añadir nuevo
  2. Elige el menú ‘Subir’
  3. Haz click en el botón ‘Elegir archivo’ y selecciona en tu explorador el archivo que has descargado
  4. Haz click en el botón ‘Instalar ahora’
  5. Ve a Plugins -> Plugins instalados y haz click en el enlace ‘Activar’ de debajo de SG CachePress en el listado de WordPress


Leer todas las 220 reseñas

Colaboradores y desarrolladores

“SG Optimizer” es un software de código abierto. Las siguientes personas han colaborado con este plugin.


“SG Optimizer” ha sido traducido a 6 idiomas. Gracias a los traductores por sus colaboraciones.

Traduce “SG Optimizer” a tu idioma.

¿Interesado en el desarrollo?

Revise el código , eche un vistazo al repositorio SVN , o suscríbase al log de desarrollo por RSS .

Registro de cambios

Version 5.3.3

  • Improved browser cache handling upon plugin update
  • Added wp-cli commands for Dynamic Cache, Autoflush and Browser-Speciffic cache handling

Version 5.3.2

  • Fixed bug with https enforce for www websites
  • Improved JILT support

Version 5.3.1

  • Better SSL force to accommodate websites with WWW in the URL
  • Global exclusion of siteorigin-widget-icon-font-fontawesome from Combine CSS

Version 5.3.0

  • Refactoring of the Lazy Load functionality
  • Redesign of the Lazy Load screen
  • Improved WooCommerce product image Lazy Load
  • Gzip functionality update for Site Tools accounts
  • Browser caching functionality update for Site Tools accounts
  • Improved Browser caching functionality for cPanel accounts

Version 5.2.5

  • New Feature: Option to split caches per User Agent
  • New Feature: Option to disable lazy loading for mobile devices
  • Improved Memcached check

Version 5.2.4

  • Improved XML RCP checks compatibility

Version 5.2.3

  • Improved LazyLoad

Version 5.2.2

  • Improved Events Calendar Compatibility
  • Suppressed notices in the REST API in certain cases
  • Improved nonscript tag in LazyLoad

Version 5.2.1

  • Improved Cloudflare compatibility

Version 5.2.0

  • Exclude list Interface for JavaScript handlers
  • Exclude list Interface for CSS handlers
  • Exclude list Interface for HTML minification (URL like dynamic)
  • Exclude list interface for LazyLoading (Class)
  • Improved Thrive Architect support
  • Fixed notice when purging comment cache

Version 5.1.3

  • Improved Elementor support
  • Improved CSS optimization for inclusions without protocol
  • Excluded large PNGs from optimizations
  • Added better WP-CLI command documentation

Version 5.1.2

  • Added support for Recommended by SiteGround PHP Version
  • Improved LazyLoad Support for WooCommerce sites
  • Improved Image Optimization checks
  • Improved PHP Version switching checks
  • Added wp cli status command for checking optimization status
  • Fixed bug with Combine CSS

Version 5.1.1

  • Improved cache invalidation for combined styles
  • Cache purge from the admin bar now handles combined files too
  • Added filter to exclude images from Lazy Loading
  • Added filter to exclude pages from HTML Minification
  • Added Filter to query params from HTML Minification
  • Added PHP 7.3 support

Version 5.1.0

  • Added CSS Combination Functionality
  • Added Async Load of Render-Blocking JS
  • Added WooCommerce Support for LazyLoad
  • Added Filter to Exclude Styles from CSS Combination
  • Improved Lazy Load Functionality on Mobile Devices
  • Fixed Issue with WP Rocket’s .htaccess rules and GZIP
  • Fixed Issue with Query String Removal Script in the Admin Section
  • Fixed Compatibility Issues with 3rd Party Plugins and Lazy Load
  • Fixed Compatibility Issues with Woo PDF Catalog Plugin and HTML Minification
  • Improved Memcached Reliability
  • Improved Lazy Load for Responsive Images

Version 5.0.13

  • Modified HTML minification to keep comments
  • Interface Improvements
  • Better input validation and sanitation for PHP Version check
  • Improved security

Version 5.0.12

  • Better cache purge for multisite
  • Surpress dynamic cache notices for localhost sites

Version 5.0.11

  • Improved handling of third party plugins causing issues with the compatibility checker functionality
  • Optimized WP-CLI commands for better performance
  • Better notice handling for Multisite and conflicting plugins

Version 5.0.10

  • Fixed issue with Mythemeshop themes
  • Fixed issues with exclude URL on update
  • Fixed issues with exclude URL on update
  • Exclude Lazy Load from AMP pages
  • Exclude Lazy Load from Backend pages
  • Fixed WPML problems
  • Fixed Beaver Builder issues
  • Fixed Spanish translations
  • Fixed incompatibility with JCH Optimize

Version 5.0.9

  • Fixed woocommerce bugs
  • Improved memcached flush
  • Improved https force

Version 5.0.8

  • Better .htaccess handling when disabling and enabling Browser Cache and Gzip
  • Improved image optimization handling
  • Added option to stop the image optimization and resume it later
  • Fixed bug with memcached notifications
  • Fixed bug with conflicting plugin notices for non-admins
  • Fixed bug when user accesses their site through IP/~cPaneluser
  • Fixed bug with labels for HTML, CSS & JS Minification
  • SEO Improvements in the Lazy Load functionality

Version 5.0.7

  • Fixed bug with notifications removal
  • Fixed bug with modifying wrong .htaccess file for installations in subdirectory
  • Flush redux cache when updating to new version
  • Improved check for existing SSL rules in your .htaccess file
  • Added check and removal of duplicate Gzip rules in your .htaccess file
  • Added check and removal of duplicate Browser caching rules in your .htaccess file

Version 5.0.6

  • Memcache issues fixed. Unique WP_CACHE_KEY_SALT is generated each time you enable it on your site.
  • Better status update handling
  • Added option to start checks even if the default WP Cron is disabled (in case you use real cronjob)

Version 5.0.5

  • Fixed Compatibility Checker progress issues.
  • Fixed images optimization endless loops.
  • Changed php version regex to handle rules from other plugins.

Version 5.0.4

  • Fixed CSS minification issues.
  • Add option to re-optimize images.
  • Allow users to hide notices.

Version 5.0.0

  • Complete plugin refactoring
  • Frontend optimiztions added
  • Environment optimizations added
  • Images Optimizatoins adder
  • Full WP-CLI Support
  • Better Multisite Support
  • Better Interface

Version 4.0.7

  • Fixed bug in the force SSL functionality in certain cases for MS
  • Added information about the cookie our plugin uses in the readme file

Version 4.0.6

  • Bug fixes
  • Better https enforcement in MS environment

Version 4.0.5

  • Removed stopping of WP Rocket cache

Version 4.0.4

  • Correcciones de errores menores

Version 4.0.3

  • Switching recommended PHP Version to 7.1

Version 4.0.2

  • WPML and Memcache / Memcached bug fix

Version 4.0.1

  • Correcciones de errores menores
  • UK locale issue fixed

Version 4.0.0

  • Added proper Multisite support
  • Quick optimizations – Gzip and Browser cache config settings for the Network Admin
  • Network admin can purge the cache per site
  • Network admin can disallow Cache and HTTPS configuration pages per site
  • WPML support when Memcached is enabled
  • Cache is being purged per site and not for the entire network
  • Multiple performance & interface improvements
  • Security fixes against, additional access checks introduced
  • Fixed minor cosmetic errors in the interface

Version 3.3.3

  • Solucionados problemas menores de la interfaz

Version 3.3.2

  • Solucionando fallo al desactivar la opción de Forzar HTTPS

Version 3.3.1

  • Fixed cache purge issue when CloudFlare is enabled
  • Añadido registro de intentos fallidos en la API XMLRPC.

Version 3.3.0

  • Mejorada la función de vaciado público para los desarrolladores de temas y plugins
  • Añadido comando WP-CLI para vaciar la caché – wp sg purge

Version 3.2.4

  • Memcache.tpl actualizado
  • Arreglado un enlace en el interfaz de PHP Check

Version 3.2.3

  • Mejoras en la compatibilidad con WP-CLI

Version 3.2.1

  • Mejoras en el fallback del cron, añadido un mensaje de error si WP CRON está inactivo

Version 3.2.0

  • Añadida comprobación de compatibilidad con PHP 7.0 y cambio de versión de PHP

Version 3.0.5

  • Comprobación de certificado mejorado

Version 3.0.4

  • Solucionado fallo con .htaccess sin permisos de escritura

Version 3.0.3

  • Solucionado fallo al añadir archivos CSS

Version 3.0.2

  • Añadido user-agent a la comprobación de disponibilidad SSL

Version 3.0.1

  • Ajustes de compatibilidad PHP

Version 3.0.0

  • Plugin renombrado a SG Optimizer
  • Interfaz separada en varias pantallas
  • Añadida la funcionalidad de forzar HTTPS que reconfigura WordPress, hace una redirección .htaccess para forzar todo el tráfico a través de HTTPS y soluciona cualquier problema potencial de contenido inseguro
  • Plugin preparado para la herramienta de comprobación de compatibilidad y cambio de versión PHP

Version 2.3.11

  • Añadida la función de purgado público
  • Soluciones a errores en memcached

Version 2.3.10

  • Mejoras en el rendimiento de memcached
  • Soluciones a errores en memcached

Version 2.3.9

  • Mejorada la compatibilidad con WordPress 4.6

Version 2.3.8

  • Mejoras de compatibilidad con el sistema de staging de SiteGround

Version 2.3.7

  • Solucionados avisos PHP en las clases Object Cache

Version 2.3.6

  • Soluciones a errores menores en gestión de URLs

Version 2.3.5

  • Mejoras en la detección de URL en la comprobación de cache

Version 2.3.4

  • Soluciones de fallos de CSS

Version 2.3.3

  • Trabajo mejorado Memcache
  • Mejoras en la interfaz
  • Bug fixes

Version 2.3.2

  • Se corrigió un error con la limpieza de caché Memcached

Version 2.3.1

  • Mejoras en la interfaz
  • Soporte de internacionalización añadido
  • Traducción a español – Costa Rica añadida por giankocr0
  • Traducción al búlgaro

Version 2.3.0

  • Memcached soporte añadido
  • Mejor compatibilidad con PHP7

Version 2.2.11

  • Compatibilidad mejorada con WP Rocket
  • Bug fixes

Version 2.2.10

  • Revamped notices work
  • Bug fixes

Version 2.2.9

  • Bug fixes

Version 2.2.8

  • Bug fixing and improved notification behaviour
  • Fixed issues with MS installations

Version 2.2.7

  • Added testing box and notification if Dynamic Cache is not enabled in cPanel

Version 2.2.6

  • Error corregido con Memcached causando problemas después de la actualización de la base de datos WP

Version 2.2.5

  • Mejoras menores en el sistema

Version 2.2.4

  • Mejoras menores en el sistema

Version 2.2.3

  • Enlace de barra de administración visible sólo para usuarios de administrador

Version 2.2.2

  • Correcciones de errores menores

Version 2.2.1

  • Se agregó el botón Vaciar SG Cache
  • Interfaz amigable para móviles rediseñada

Version 2.2.0

  • Añadido soporte NGINX

Version 2.1.7

  • Corregido el error de activación de complemento

Version 2.1.6

  • El botón de vaciar ahora borrará la caché estática incluso si la caché dinámica no está habilitada
  • Mejor y más claro etiquetado del botón

Version 2.1.5

  • Mejorando activación de complementos y añadido al reporte de

Version 2.1.2

  • Corregido un error que impide habilitar Memcached cuando se utiliza un certificado SSL comodín

Version 2.1.1

  • El caché se descargará cuando los mensajes programados se conviertan en live

Version 2.1.0

  • El caché se vaciará si WordPress se autoactualiza

Version 2.0.3

  • Correcciones de errores menores

Version 2.0.2

  • 3.8 soporte añadido

Version 2.0.1

  • Mejoras en la interfaz
  • Correcciones de errores menores

Version 2.0

  • Nueva interfaz
  • Correcciones de errores menores
  • Configuración y limpieza páginas combinadas en una sola

Version 1.2.3

  • Correcciones de errores menores
  • SiteGround Memcached soporte añadido
  • Excluir URL de la lista de caché


  • Plugin creado.