---
title: Filtrer la requête d’aperçu réel utilisée par l’analyse de contenu
url: "https://www.seopress.org/fr/support/hooks/filtrer-la-requete-dapercu-reel-utilisee-par-lanalyse-de-contenu/"
lang: fr-FR
updated: 2026-10-20
hook_name: 4.2
required_version: seopress_real_preview_custom_args, seopress_real_preview_remote
---

# Filtrer la requête d’aperçu réel utilisée par l’analyse de contenu

- **Hook name:** `4.2`
- **Required version:** seopress_real_preview_custom_args, seopress_real_preview_remote

```php
<?php
/**
 * Add query arguments to the preview URL of a post (useful for page / theme builders).
 * Default: array( 'no_admin_bar' => 1 ).
 *
 * @param array $args Query arguments passed to get_preview_post_link().
 * @return array
 */
function sp_real_preview_custom_args( $args ) {
	$args['my_builder_preview'] = 1;

	return $args;
}
add_filter( 'seopress_real_preview_custom_args', 'sp_real_preview_custom_args' );

/**
 * Change the arguments of the HTTP request (wp_remote_get style) that fetches the preview.
 * Applied last: headers, cookies, timeout and sslverify can all be changed here.
 * The "redirection" argument is always forced back to 0.
 *
 * @param array $args HTTP request arguments.
 * @return array
 */
function sp_real_preview_remote( $args ) {
	$args['timeout']            = 20;
	$args['headers']['X-My-Auth'] = 'secret-token';

	return $args;
}
add_filter( 'seopress_real_preview_remote', 'sp_real_preview_remote' );
```

Source: [https://gist.github.com/wp-seopress/1df3e2a19845ce8551de7d8c11e8ce42](https://gist.github.com/wp-seopress/1df3e2a19845ce8551de7d8c11e8ce42)


`seopress_real_preview_custom_args` existe depuis la 5.0, `seopress_real_preview_remote` depuis la 4.2 ou avant.
