Control Render Better with <head> attributes

Render Better gives you complete control over whether optimizations are used, which optimizations are run, and whether optimizations are updated or not by adding attributes to the <head> tag in your HTML. Using these attributes

These attributes are checked per request, which gives you complete control over Render Better for each visitor.

Disable all optimizations

To disable all optimizations from being applied to the current page, use the data-rb-disabled attribute.

Example code

<!doctype html>
<html>
<!-- Settings should be added to the <head> tag as attributes -->
<head data-rb-disabled>
<!-- ... the rest of your HTML follows -->

Specify which optimizations to use

To specify which exact optimizations to use for a request, use the data-rb-optimizers attribute.

Note that Render Better may not run an Optimizer even if it’s specified in the HTML if for some reason it’s unsafe or is unavailable. You can verify which Optimizers ran by using the ?rb_info query flag as described in the Verifying the attributes are working correctly section. If you don’t see an Optimizer you specified running, verify you spelled the Optimizer Key correctly.

Available Optimizers

To find which optimizations are available, append ?rb_info to your website’s URL (e.g. example.com/?rb_info) and view the HTML source code. A list of optimizations should be available there that can be explicitly enabled or disabled via the data-rb-optimizers <head> tag attribute.

Example code

The following code would enable only the critical-css, third-party-deferral, and aspect-ratios optimizations

<!doctype html>
<html>
<!-- Settings should be added to the <head> tag as attributes -->
<head data-rb-optimizers="critical-css,third-party-deferral,aspect-ratios">
<!-- ... the rest of your HTML follows -->

Disable optimization updates

To prevent optimizations from updating, use the data-rb-update-disabled attribute.

Example code

<!doctype html>
<html>
<!-- Settings should be added to the <head> tag as attributes -->
<head data-rb-update-disabled>
<!-- ... the rest of your HTML follows -->

Reference of all attribute settings

Attribute
Example
Description
data-rb-disabled
<head data-rb-disabled>
Disables Render Better optimizations and return the page as is.
data-rb-optimizers
<head data-rb-optimizers="critical-css, aspect-ratios, async-defer">
Specifies the exact optimizers to run. This comma separated list will be the only optimizers that are run for the page. Any optimizers not in this list will not be run. For a list of acceptable values please reference the Available Optimizers.
data-rb-disabled-optimizers
<head data-disabled-optimizers="critical-css, aspect-ratios, async-defer">
Prevents specific optimizers from running for the page. For a list of acceptable values please reference the Available Optimizers.

How to verify the attributes are working correctly

You can verify that Render Better has detected attribute settings by adding the ?rb_info query string parameter to any URL and following the steps outlined below:

  1. View the ‘page source’ of your site by right clicking anywhere in your site and click “View page source”:
  2. image
  3. At the top of the <head> tag you should see the following informational report from Render Better indicating the settings that it detected:
  4. image