Title: wp_robots_max_image_preview_large
Published: March 9, 2021
Last modified: August 20, 2026

---

# wp_robots_max_image_preview_large( array $robots ): array

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#changelog)

Adds `max-image-preview:large` to the robots meta tag.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#description)󠁿

This directive tells web robots that large image previews are allowed to be displayed,
e.g. in search engines, unless the blog is marked as not being public.

Typical usage is as a [‘wp_robots’](https://developer.wordpress.org/reference/hooks/wp_robots/)
callback:

    ```php
    add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' );
    ```

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

 `$robots`arrayrequired

Associative array of robots directives.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_robots_max_image_preview_large/?output_format=md#return)󠁿

 array Filtered robots directives.

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

    ```php
    function wp_robots_max_image_preview_large( array $robots ) {
    	if ( get_option( 'blog_public' ) ) {
    		$robots['max-image-preview'] = 'large';
    	}
    	return $robots;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/robots-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/robots-template.php#L188)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/robots-template.php#L188-L193)

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

| Uses | Description | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

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

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

## User Contributed Notes

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