Skip to main content

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_ids

nginx

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 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.
Is add_ids enabled by default?
No. add_ids is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable add_ids on Apache and nginx?
Add ModPagespeedEnableFilters add_ids on Apache or pagespeed EnableFilters add_ids; on nginx. On IIS, add pagespeed EnableFilters add_ids to pagespeed.config.

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

Search