Skip to main content

filter · HTML filters

Remove quotes (remove_quotes)

Category:
HTML
CoreFilters:
No
OptimizeForBandwidth:
No
Risk:
Generally safe

Removes unnecessary quotation marks around HTML attribute values when the value contains no special characters. Saves a few bytes per attribute.

When to use it

  • Not in CoreFilters: it runs only when you enable it by name.
  • Risk rating on these docs: Generally safe.

Risks

The HTML filters page lists no specific risks for this filter. If a page misbehaves with it, DisableFilters remove_quotes turns it off for the scope you set it in.

Configuration

Enable it in the module configuration, at server, virtual-host or location scope:

Apache

ModPagespeedEnableFilters remove_quotes

nginx

pagespeed EnableFilters remove_quotes;

IIS (pagespeed.config)

pagespeed EnableFilters remove_quotes

Scoping, ForbidFilters and the thresholds filters read: Choosing filters .

Live example

Removes quotes around HTML attribute values where they are not required.

Measured on the demo page, original against optimized:

  • HTTP requests

    2 → 1 −1

  • Total bytes

    3.9 KB → 179 B −95%

  • HTML size

    189 B → 179 B −5%

See the before and after, with the source diff →

Frequently asked questions

What does the remove_quotes filter do?
Removes unnecessary quotation marks around HTML attribute values when the value contains no special characters. Saves a few bytes per attribute.
Is remove_quotes enabled by default?
No. remove_quotes is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable remove_quotes on Apache and nginx?
Add ModPagespeedEnableFilters remove_quotes on Apache or pagespeed EnableFilters remove_quotes; on nginx. On IIS, add pagespeed EnableFilters remove_quotes to pagespeed.config.

This page is drawn from the remove_quotes entry on HTML filters. Every filter in one table: PageSpeed filters.

Search