Skip to main content

filter · HTML filters

Rule packs (rule_packs)

Category:
HTML
CoreFilters:
No
OptimizeForBandwidth:
No
Risk:
Dangerous set

Applies the rules of a rule pack, a JSON file named by RulePackFile, to the canonical link, title, meta description, hreflang cluster and JSON-LD of your pages. It is off by default and in no rewrite level: it is in the dangerous set, so RewriteLevel AllFilters does not enable it either. A pack starts in report mode (RulePackMode report, the default) and records what it would change without changing anything.

How it works

See Rule packs for the pack format, enforce mode and signed packs.

When to use it

  • In the dangerous set: no RewriteLevel enables it, not even AllFilters. It exists for testing and measurement, not for production traffic.
  • Risk rating on these docs: Dangerous.
  • Off by default and in no rewrite level; a pack starts in report mode and changes nothing until enforced

Risks

The HTML filters page lists no specific risks for this filter. If a page misbehaves with it, DisableFilters rule_packs 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 rule_packs

nginx

pagespeed EnableFilters rule_packs;

IIS (pagespeed.config)

pagespeed EnableFilters rule_packs
pagespeed EnableFilters rule_packs;
pagespeed RulePackFile /etc/pagespeed/packs/example.com.json;

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

Frequently asked questions

What does the rule_packs filter do?
Applies the rules of a rule pack, a JSON file named by RulePackFile, to the canonical link, title, meta description, hreflang cluster and JSON-LD of your pages. It is off by default and in no rewrite level: it is in the dangerous set, so RewriteLevel AllFilters does not enable it either. A pack starts in report mode (RulePackMode report, the default) and records what it would change without changing anything.
Is rule_packs enabled by default?
No. rule_packs is in the dangerous set, which no RewriteLevel enables, not even AllFilters. Enable it by name, for testing and measurement only.
How do I enable rule_packs on Apache and nginx?
Add ModPagespeedEnableFilters rule_packs on Apache or pagespeed EnableFilters rule_packs; on nginx. On IIS, add pagespeed EnableFilters rule_packs to pagespeed.config.

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

Search