filter · HTML filters
Add IDs (add_ids)
- Category:
- HTML
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Not rated
Adds an id attribute to elements that have none, so that beacon-driven filters can refer to individual elements across page loads. Rarely needed on its own: the filters that need ids enable it themselves. Risk: scripts or styles that count on the exact set of ids in the page see extra ones.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
Risks
The
HTML filters
page lists no specific risks for this filter.
If a page misbehaves with it, DisableFilters add_ids 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 add_idsnginx
pagespeed EnableFilters add_ids;IIS (pagespeed.config)
pagespeed EnableFilters add_ids
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Frequently asked questions
- What does the add_ids filter do?
- Adds an
idattribute to elements that have none, so that beacon-driven filters can refer to individual elements across page loads. Rarely needed on its own: the filters that need ids enable it themselves. Risk: scripts or styles that count on the exact set of ids in the page see extra ones. - Is add_ids enabled by default?
- No.
add_idsis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable add_ids on Apache and nginx?
- Add
ModPagespeedEnableFilters add_idson Apache orpagespeed EnableFilters add_ids;on nginx. On IIS, addpagespeed EnableFilters add_idsto pagespeed.config.
Related filters
- add_base_tag — Add base tag
- add_head — Add head
- add_instrumentation — Add instrumentation
- collapse_whitespace — Collapse whitespace
- combine_heads — Combine heads
- compute_statistics — Compute HTML statistics
- convert_meta_tags — Convert meta tags
- debug — Debug comments
This page is drawn from the add_ids entry on HTML filters. Every filter in one table: PageSpeed filters.