Overview
↑ Back to topStore Vacation Mode lets you temporarily close a WooCommerce store for holidays, maintenance, or restocking without hiding it. Your pages stay online and fully indexable with normal HTTP 200 responses (SEO safe), but purchasing is disabled and a customizable notice tells customers when the store reopens. You can close the store instantly with a manual switch or schedule it between two dates in the site timezone, with no cron jobs, because the open/closed status is computed live on every request. A live status card, a customizable banner, and an admin bar badge keep you and your team informed.
Installation
↑ Back to top- Upload the
store-vacation-modefolder to the/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- Navigate to WooCommerce > Settings > Advanced > Vacation Mode to configure
The master switch (Enable Plugin) is off by default, so activating the plugin does not close your store until you enable it.
Requirements
↑ Back to top- WordPress 6.4 or higher
- WooCommerce 9.0 or higher
- PHP 7.4 or higher
Settings
↑ Back to topAccess settings at WooCommerce > Settings > Advanced > Vacation Mode (admin.php?page=wc-settings&tab=advanced§ion=vacation-mode). The settings page is a React app organized into three tabs.
General
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Store Status | Live status card computed from the manual switch and the schedule. Shows OPEN or CLOSED, the reason, and the next scheduled change. Read-only; refreshed on save. | n/a |
| Enable Plugin | Master switch. When disabled, no vacation mode features, hooks, or logic are active at all. | Disabled (no) |
| Vacation mode active | Manual switch. When on, the store is closed immediately, regardless of the schedule, until switched off. | Off (no) |
| Enable schedule | When enabled, the store closes between the start and end dates below. | Off (no) |
| Start date | Datetime (site timezone) when the scheduled closure begins. Leave empty to close from now. | Empty ('') |
| End date | Datetime (site timezone) when the scheduled closure ends. Leave empty to stay closed until reopened manually. Also feeds the {reopen_date} placeholder. | Empty ('') |
Message
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Notice text | The message shown to customers while the store is closed. Supports the {reopen_date} placeholder and basic HTML. | We are currently on vacation. Orders will resume on {reopen_date}. |
| Notice position | Where the notice appears: top_bar (site-wide top bar), before_shop (before shop, cart, and checkout content), or both. | both |
| Background color | Banner and inline notice background color. | #b91c1c |
| Text color | Banner and inline notice text color. | #ffffff |
Behavior
↑ Back to top| Setting | Description | Default |
|---|---|---|
| Disable purchasing | Makes products non-purchasable, removes add-to-cart buttons, and blocks checkout while the store is closed. Existing carts are kept but cannot be checked out. | Enabled (yes) |
| Hide prices | Also hides product prices while the store is closed. | Disabled (no) |
| Show admin bar badge | Shows a red “Vacation Mode ON” badge in the admin bar (for users who can manage WooCommerce) while the store is closed, linking to this settings page. | Enabled (yes) |
All settings are stored together in a single svm_settings option.
How It Works
↑ Back to top- Turn on the Enable Plugin master switch in the General tab.
- Close the store either immediately (turn on Vacation mode active) or on a schedule (enable the schedule and set dates).
- While the store is closed, products are made non-purchasable, add-to-cart buttons are removed, checkout is blocked, and the vacation notice is shown according to its position.
- Pages continue to return HTTP 200 and stay indexable throughout; nothing is redirected to a maintenance page.
- Reopen by switching off the manual switch or letting the scheduled window end; the store returns to normal on the next page load.
Notice placeholder
↑ Back to topThe notice text supports a single {reopen_date} placeholder. When the schedule is enabled and an end date is set, the placeholder is replaced with the end date formatted using the site date format. When there is no end date, the placeholder is removed along with a leading preposition (on, by, from, until, after) and any leftover punctuation spacing is cleaned up, so the sentence still reads correctly.
The is_store_closed Logic
↑ Back to topThe core of the plugin is SVM_Vacation::is_store_closed(). The store is considered closed only when:
- The Enable Plugin master switch is on (
enabled === 'yes'), AND - Either:
- The manual switch is on (
vacation_active === 'yes'), in which case the store is closed immediately; OR - The schedule is enabled (
schedule_enabled === 'yes') AND the current time falls within the configured window.
The scheduled window is evaluated by is_within_schedule() using current_datetime() (WordPress site timezone):
- An empty start date means “from now” (no lower bound).
- An empty end date means “until manually reopened” (no upper bound).
- The store is closed when the current time is at or after the start date (if set) and at or before the end date (if set).
Dates are parsed from the YYYY-MM-DDTHH:MM format into a DateTimeImmutable in the site timezone (wp_timezone()). Because the status is computed live on each request, there are no WP-Cron events involved and scheduled transitions happen exactly on time.
SVM_Vacation::get_status() returns a structured status (is_closed, human-readable reason, current time, and next scheduled change) that powers the live status card and the /status REST endpoint.
Frontend Behavior While Closed
↑ Back to topAll frontend behavior is registered by SVM_Frontend only when the store is closed:
- Disable purchasing (when enabled): filters
woocommerce_is_purchasableandwoocommerce_variation_is_purchasableto return false (which also blocks Store API add-to-cart), removes the loop add-to-cart link, redirects the checkout page to the cart with the notice, and rejects classicwoocommerce_checkout_processsubmissions. - Hide prices (when enabled): filters
woocommerce_get_price_htmlto return an empty string. - Notices: renders a site-wide top banner (on
wp_body_open, with awp_footerfallback) and/or an inline notice before shop, cart, and checkout content, depending on the notice position. Both use the configured background and text colors.
Developer Hooks
↑ Back to topThe plugin exposes two filters:
| Hook | Type | Description |
|---|---|---|
svm_is_store_closed | filter | Filter the boolean result of whether the store is currently closed. Params: $closed (bool). |
svm_vacation_notice_text | filter | Filter the customer notice text after {reopen_date} replacement. Params: $text (string), $settings (array). |
REST API
↑ Back to topNamespace: svm/v1. All routes require the manage_woocommerce capability.
| Route | Methods | Description |
|---|---|---|
/settings | GET, POST | Get or update plugin settings |
/status | GET | Get the current live store status (is_closed, reason, now, next_change) |
HPOS Compatibility
↑ Back to topStore Vacation Mode declares full compatibility with WooCommerce High-Performance Order Storage (HPOS) and Cart/Checkout Blocks via FeaturesUtil::declare_compatibility for custom_order_tables and cart_checkout_blocks.