Skip to main content
ModPageSpeed 2.0 and mod_pagespeed 1.1 — Coming Soon

Filter Reference

Complete reference table of all 56 mod_pagespeed 1.1 filters. Names, categories, CoreFilter status, safety ratings, and descriptions at a glance.

Platform syntax

Filter names are the same across all platforms. The directive syntax differs:

PlatformEnable filterDisable filter
nginxpagespeed EnableFilters rewrite_images;pagespeed DisableFilters rewrite_images;
ApacheModPagespeedEnableFilters rewrite_imagesModPagespeedDisableFilters rewrite_images
IISpagespeed EnableFilters rewrite_imagespagespeed DisableFilters rewrite_images

IIS uses the same pagespeed prefix as nginx but without the trailing semicolon. All directives go in pagespeed.config. See IIS Configuration for the full file format reference.

All filters

FilterCategoryCoreOFBDescriptionSafe
add_headHTMLYesNoAdds <head> element if missingGenerally safe
add_instrumentationHTMLNoNoInjects JavaScript to measure page load timeTest first
collapse_whitespaceHTMLNoNoRemoves excess whitespace from HTMLGenerally safe
combine_cssCSSYesNoCombines multiple CSS files into oneGenerally safe
combine_headsHTMLNoNoMerges multiple <head> elementsGenerally safe
combine_javascriptJavaScriptYesNoCombines multiple JS files into oneGenerally safe
convert_gif_to_pngImageYesYesConverts GIF to PNGGenerally safe
convert_jpeg_to_progressiveImageYesYesConverts large JPEGs to progressive formatGenerally safe
convert_jpeg_to_webpImageYesYesConverts JPEG to WebP for capable browsersGenerally safe
convert_meta_tagsHTMLYesNoAdds HTTP headers from <meta http-equiv> tagsGenerally safe
convert_png_to_jpegImageYesYesConverts PNG to JPEG when no transparencyGenerally safe
convert_to_webp_animatedImageNoNoConverts animated GIF to WebPTest first
convert_to_webp_losslessImageNoNoConverts PNG/GIF to lossless WebPGenerally safe
dedup_inlined_imagesImageNoNoReplaces repeated inlined images with JS referenceTest first
defer_javascriptJavaScriptNoNoDefers JS execution until after page loadTest first
elide_attributesHTMLNoNoRemoves default-value HTML attributesGenerally safe
extend_cacheCachingYesNoContent-hashed URLs with 1-year browser cacheGenerally safe
extend_cache_pdfsCachingNoNoCache extension for PDF linksGenerally safe
fallback_rewrite_css_urlsCSSYesNoRewrites resource URLs in unparseable CSSGenerally safe
flatten_css_importsCSSYesNoInlines CSS @import rulesGenerally safe
hint_preload_subresourcesHTMLNoNoAdds Link: rel=preload headersGenerally safe
in_place_optimize_for_browserImageNoYesBrowser-specific in-place optimizationTest first
inline_cssCSSYesNoInlines small external CSS into HTMLGenerally safe
inline_imagesImageYesNoInlines small images as data: URIsGenerally safe
inline_import_to_linkCSSYesNoConverts <style>@import</style> to <link>Generally safe
inline_javascriptJavaScriptYesNoInlines small external JS into HTMLGenerally safe
inline_preview_imagesImageNoNoInserts low-quality image placeholdersTest first
insert_dns_prefetchHTMLNoNoAdds <link rel=dns-prefetch> for third-party domainsGenerally safe
insert_image_dimensionsImageNoNoAdds width and height attributes to <img> tagsGenerally safe
jpeg_samplingImageYesYesReduces chroma sampling to 4:2:0Generally safe
lazyload_imagesImageNoNoDefers offscreen image loadingTest first
local_storage_cacheCachingNoNoCaches inlined resources in localStorageExperimental
move_css_above_scriptsCSSNoNoMoves CSS <link> above <script> tagsGenerally safe
move_css_to_headCSSNoNoMoves CSS <link> into <head>Generally safe
outline_cssCSSNoNoExternalizes large inline CSS blocksExperimental
outline_javascriptJavaScriptNoNoExternalizes large inline JS blocksExperimental
pedanticHTMLNoNoAdds type attributes for HTML4 validationGenerally safe
prioritize_critical_cssCSSNoNoInlines above-fold CSS, defers the restTest first
recompress_imagesImageYesYesLossless image recompressionGenerally safe
recompress_jpegImageYesYesJPEG-specific recompressionGenerally safe
recompress_pngImageYesYesPNG-specific recompressionGenerally safe
recompress_webpImageYesYesWebP-specific recompressionGenerally safe
remove_commentsHTMLNoNoStrips HTML commentsGenerally safe
remove_quotesHTMLNoNoRemoves unnecessary attribute quotesGenerally safe
resize_imagesImageYesNoResizes images to match <img> dimensionsGenerally safe
resize_mobile_imagesImageNoNoSmaller placeholders for mobileTest first
resize_rendered_image_dimensionsImageYesNoResizes to rendered dimensionsTest first
responsive_imagesImageNoNoGenerates srcset for multiple resolutionsTest first
rewrite_cssCSSYesYesMinifies CSS, rewrites embedded URLsGenerally safe
rewrite_domainsCachingNoNoApplies domain mappings to original resourcesTest first
rewrite_imagesImageYesNoMaster image optimization (enables sub-filters)Generally safe
rewrite_javascriptJavaScriptYesYesMinifies JavaScriptGenerally safe
rewrite_javascript_externalJavaScriptYesYesMinifies external JavaScript filesGenerally safe
rewrite_javascript_inlineJavaScriptYesYesMinifies inline JavaScriptGenerally safe
rewrite_style_attributesCSSNoNoApplies CSS rewriting to inline style attributesGenerally safe
rewrite_style_attributes_with_urlCSSYesNoSame, only for styles containing url()Generally safe
sprite_imagesImageNoNoCombines CSS background images into spritesTest first
strip_image_color_profileImageYesYesRemoves ICC color profilesGenerally safe
strip_image_meta_dataImageYesYesRemoves EXIF and other metadataGenerally safe
trim_urlsHTMLNoNoShortens URLs relative to base URLGenerally safe

Notes

  • Core filters are enabled by default with RewriteLevel CoreFilters. Some image sub-filters (e.g., recompress_images, jpeg_sampling, strip_image_meta_data) are implicitly enabled by their parent filter rewrite_images and are marked Core for that reason. See Filter Selection for the explicit CoreFilters list.
  • OFB filters are active under RewriteLevel OptimizeForBandwidth, which optimizes resources in-place without rewriting URLs.
  • “Test first” filters are safe for most sites but can cause issues with specific JavaScript frameworks or CSS patterns. Test on a staging environment before enabling in production.
  • “Experimental” filters are available but rarely needed. Use only if you have a specific reason.

Deprecated filters

These filters remain available for backward compatibility but target retired or deprecated services:

  • canonicalize_javascript_libraries —redirects to Google Hosted Libraries CDN
  • insert_ga —inserts Google Analytics snippet (ga.js is retired)
  • make_google_analytics_async —targets retired ga.js
  • make_show_ads_async —targets deprecated AdSense show_ads.js

See also