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_packsnginx
pagespeed EnableFilters rule_packs;IIS (pagespeed.config)
pagespeed EnableFilters rule_packspagespeed 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, soRewriteLevel AllFiltersdoes 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_packsis in the dangerous set, which no RewriteLevel enables, not evenAllFilters. Enable it by name, for testing and measurement only. - How do I enable rule_packs on Apache and nginx?
- Add
ModPagespeedEnableFilters rule_packson Apache orpagespeed EnableFilters rule_packs;on nginx. On IIS, addpagespeed EnableFilters rule_packsto pagespeed.config.
Related filters
- add_base_tag — Add base tag
- add_head — Add head
- add_ids — Add IDs
- add_instrumentation — Add instrumentation
- collapse_whitespace — Collapse whitespace
- combine_heads — Combine heads
- compute_statistics — Compute HTML statistics
- convert_meta_tags — Convert meta tags
This page is drawn from the rule_packs entry on HTML filters. Every filter in one table: PageSpeed filters.