Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manoj-lk-code/wp-auto-post-cleanup
Deletes all posts and their associated images that are older than 90 days in your WordPress website.
https://github.com/manoj-lk-code/wp-auto-post-cleanup
Last synced: 6 days ago
JSON representation
Deletes all posts and their associated images that are older than 90 days in your WordPress website.
- Host: GitHub
- URL: https://github.com/manoj-lk-code/wp-auto-post-cleanup
- Owner: manoj-lk-code
- License: gpl-3.0
- Created: 2023-02-22T10:56:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-23T00:55:15.000Z (almost 2 years ago)
- Last Synced: 2024-02-07T18:34:37.206Z (11 months ago)
- Language: PHP
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wp-auto-post-cleanup
Deletes all posts and their associated images that are older than 90 days in your WordPress website.
# Download
You can download plugin zip file.
# cronjob
Make sure your wordpress cronjob is working.
# Days
You can change number of days in the file.
# Post batch
By default it delete 5 posts. you can change that as well.
# optional but good to use.
In case if images left on wordpress that are older than 90 days, you can use below command to delete all files and folders older than 90 days.
```
find /path/to/wp/wp-content/uploads -type f -mtime +90 -delete && find /path/to/wp/wp-content/uploads -type d -empty -delete
```Here's what this command does:
- find /path/to/wp/wp-content/uploads: starts the find command in the /path/to/wp/wp-content/uploads directory.
- -type f: only looks for files, not directories.
- -mtime +90: only selects files that were modified more than 90 days ago.
- -delete: deletes the selected files.
- The && operator is used to separate two find commands. The second command looks for empty directories (-type d and -empty) and deletes them (-delete) if they are found.