Title: wp_increase_content_media_count
Published: February 3, 2022
Last modified: May 20, 2026

---

# wp_increase_content_media_count( int $amount = 1 ): int

## In this article

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

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

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Increases an internal content media count variable.

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

 `$amount`intoptional

Amount to increase by.

Default:`1`

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

 int The latest content media count, after the increase.

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

    ```php
    function wp_increase_content_media_count( $amount = 1 ) {
    	static $content_media_count = 0;

    	$content_media_count += $amount;

    	return $content_media_count;
    }
    ```

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

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

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

Gets loading optimization attributes.

  | 
| [wp_get_loading_attr_default()](https://developer.wordpress.org/reference/functions/wp_get_loading_attr_default/)`wp-includes/deprecated.php` |

Gets the default value to use for a `loading` attribute on an element.

  |

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

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

## User Contributed Notes

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