Getting Started

Deployment Deployment - Diagnose Migrations Staging

Site Management

Backups Client Reporting Passwords Plugin Automation Plugin Management - Global Plugins & Themes - Diagnose Plugins & Themes - General Plugins & Themes - Git Plugins & Themes - Logs Must Install White Label WordPress Updates

Caching & Performance

Caching Caching - Blogs/Articles Caching - Diagnose Caching - Git Caching - WooCommerce Redis Optimize & Scale

Security

Security Security - Firewall

SMTP, CDN & DNS

SMTP SendGrid CDN CDN - AWS CDN - Cloudflare CDN - Diagnose Domains & DNS

Server & Tools

Analytics & Logs CRON Jobs Database Debug Tool Git Monitoring PHP Settings Redirects SEO Tools Server Errors sFTP SSL

Staq Billing

Staq Billing > Account Staq Billing > Client Staq Billing > Setup

Media

Media Media - Diagnose Media - Optimize

Accounts & Billing

Accounts & Billing

General

WordPress Hosting Website Diagnose Troubleshoot - Other

How to clear the cache for a selected number of pages regularly


On this page

    Question

    Rather than dumping the entire site’s cache regularly, how can I schedule for the cache to clear the cache for only specific pages?

    Answer

    You can do this using the built-in Staq Cron Manager for clearing cache by page ID.

    • Go to your site in the Staq Panel and click Cron Manager and click Add:

     

    Select how often you want the job to run using the Job interval.

    In the command field, enter:

    wp wpstaq clear-cache --post_id=PAGE_ID

    Replace PAGE_ID with the ID of the page you want to clear the cache for.

    If you are not sure what the page ID is:

    • Open the page in WordPress.
    • Click Edit.
    • Look at the URL in your browser and copy the numeric ID from the address bar:

    This is how a completed cron job looks once the command and interval are set:

    Click Save to activate the job.

    You can create multiple cron jobs if you need to regularly clear the cache for more than one page.

    Need some help?

    We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.