How to force a hosted Craft CMS to perform garbage collection

SSH into the hosted Craft CMS and run php craft gc.

Oscar de la Hera Gomez
Written by Oscar de la Hera Gomez
First published on 08/07/2023 at 11:18
Last Updated on 08/07/2023 at 12:36
<p>A flower that represents Craft CMS. Beneath it sits the text "Force Garbage Collection."</p>

SSH into the hosted Craft CMS and run php craft gc.

Subscribe

Step One: SSH into the hosted Craft CMS

<p>A screenshot of Terminal showing what the terminal looks like after you have successfully accessed a hosted craft cms using SSH on Fortrabbit.</p>

Follow the tutorial below to learn how to SSH into a Craft CMS hosted on Fortrabbit.

How to SSH into a hosted Craft CMS

Step Two: Force Garbage Collection

<p>A screenshot of Terminal showing you what happens when you force garbage collection on a hosted Craft CMS.</p>

Run the following line:

php craft gc

You can also force hard-deletion for all soft-deleted rows with the delete-all-trashed option:

php craft gc --delete-all-trashed=1
Learn more about Craft CMS Garbage Collection

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
SubscribeContact UsVisit our BlogView our ServicesView our Work

Partner with us

We would love to get to know you and see how we can help your organization with its goals and needs.
Let's Talk

Stay Informed

Get occasional updates about our company, research, and product launches.
Subscribe