Title: wp_schedule_delete_old_privacy_export_files
Published: October 5, 2018
Last modified: February 24, 2026

---

# wp_schedule_delete_old_privacy_export_files()

## In this article

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

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

Schedules a `WP_Cron` job to delete expired export files.

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

    ```php
    function wp_schedule_delete_old_privacy_export_files() {
    	if ( wp_installing() ) {
    		return;
    	}

    	if ( ! wp_next_scheduled( 'wp_privacy_delete_old_export_files' ) ) {
    		wp_schedule_event( time(), 'hourly', 'wp_privacy_delete_old_export_files' );
    	}
    }
    ```

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

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

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

Checks or sets whether WordPress is in “installation” mode.

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

Retrieves the timestamp of the next scheduled event for the given hook.

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

Schedules a recurring event.

  |

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

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

## User Contributed Notes

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