Title: wp_load_speculation_rules
Published: February 24, 2026

---

# do_action( ‘wp_load_speculation_rules’, WP_Speculation_Rules $speculation_rules )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#wp--skip-link--target)

Fires when speculation rules data is loaded, allowing to amend the rules.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#parameters)󠁿

 `$speculation_rules`[WP_Speculation_Rules](https://developer.wordpress.org/reference/classes/wp_speculation_rules/)

Object representing the speculation rules to use.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#source)󠁿

    ```php
    do_action( 'wp_load_speculation_rules', $speculation_rules );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/speculative-loading.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/speculative-loading.php#L229)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/speculative-loading.php#L229-L229)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_get_speculation_rules()](https://developer.wordpress.org/reference/functions/wp_get_speculation_rules/)`wp-includes/speculative-loading.php` |

Returns the full speculation rules data based on the configuration.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_load_speculation_rules/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.8.0](https://developer.wordpress.org/reference/since/6.8.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_load_speculation_rules%2F)
before being able to contribute a note or feedback.