codingrow.com
Auto Switch Home

Schedule a Seasonal Homepage in Magento 2 (Native Guide)

Swap your homepage for Black Friday, sales or holidays without midnight manual edits: build, test, switch and automate it natively in Magento 2.

Every promotion needs a homepage that matches it, and the old one has to come back when the campaign ends. In this guide you will learn how to schedule a seasonal homepage in Magento 2 using only native tools: CMS pages, the default page setting and a small cron job.

  • Build a seasonal homepage as a separate CMS page and test it before launch
  • Switch the active homepage per store view without touching code
  • Automate the start and end dates with two CLI commands and cron
  • Avoid the SEO and caching problems that usually come with a homepage swap

Step 1: Understand how Magento chooses the homepage

Magento does not store the homepage as a special object. It simply points to one CMS page by its URL key.

  • The setting lives in the store configuration, so it can differ per website or store view.
  • Changing the pointer changes the homepage instantly, with no redirect involved.
  • That makes a swap fast and reversible, which is exactly what a campaign needs.
Do not use a 301 or 302 redirect from / to a campaign page. It slows the first request, dilutes link signals and breaks the "back to normal" moment. Change the CMS Home Page setting instead.

Step 2: Create the seasonal CMS page

Build the campaign page next to your current homepage, never on top of it.

Content›Elements›Pages

Click Add New Page and fill in the basics:

Yes
Black Friday Home
the store view that will run the campaign

Open the Search Engine Optimization section:

home-black-friday
your normal homepage title, optionally with the campaign mention
the same description your real homepage uses

Expect a new page reachable at your-store.com/home-black-friday, while the live homepage stays untouched.

Never reuse the URL key of your current homepage for the seasonal page. Two pages competing for the same URL key in the same store view will conflict.

Name every seasonal page with a clear pattern such as home-spring-sale or home-christmas. After a few campaigns you will thank yourself when picking the right one from the grid.

Step 3: Design the content

Keep the seasonal page lightweight and reuse what already works.

  • Use a 1 column layout under Design›Page Layout so the hero banner can span the full width.
  • Insert the content with Page Builder or with plain HTML, whichever your store uses today.
  • Embed existing CMS blocks for shared parts such as the USP bar or the newsletter box, so you maintain them once.
  • Link banners to category pages with relative URLs, so staging and production behave the same.
Reusing CMS blocks avoids the classic mistake of a campaign homepage that has an outdated footer promise or a stale shipping threshold.

Step 4: Test the page before it goes live

Open the page by its own URL, for example /home-black-friday, in a private browser window.

  • Check desktop and mobile widths.
  • Click every banner and button.
  • Verify that prices, product widgets and cart links work as a guest.
  • Look at the page source for the correct title and description.

Because the homepage pointer has not changed yet, customers still see the regular homepage while you test.

Do not disable the new page while it is set as the homepage. A disabled home page gives visitors a 404 on your most important URL.

Step 5: Switch the homepage in the configuration

When the campaign starts, change the pointer.

Stores›Configuration›General›Web›Default Pages

Switch the scope selector at the top to the right website or store view, then edit:

Black Friday Home

Uncheck Use Default if the field is greyed out, then click Save Config.

Expect the new page to answer on / as soon as the cache is refreshed.

The value is saved in the scope you selected. A store view value overrides the website and default values, so always check the scope selector before saving.

Step 6: Flush the cache

The full page cache keeps serving the old homepage until it is cleared.

System›Tools›Cache Management

Refresh the Configuration and Page Cache types, or run:

bin/magento cache:clean config full_page

If you use a CDN or reverse proxy in front of Magento, purge the / URL there too.

Skipping the cache flush is the most common reason a switch seems to have failed. Clear the cache after every change, both at the start and at the end of the campaign.

Open the homepage in a private window after every switch. Your own browser cache can hide a problem for hours.

Step 7: Automate the start and end dates

Manual switching at midnight is fragile. The same setting can be changed from the command line.

The configuration path is web/default/cms_home_page. To switch one store view:

bin/magento config:set --scope=stores --scope-code=default web/default/cms_home_page home-black-friday

To restore the regular page:

bin/magento config:set --scope=stores --scope-code=default web/default/cms_home_page home

Then add two server cron entries, one per date, that run the command followed by:

bin/magento cache:clean config full_page

  • Use the real URL key of your regular homepage instead of home if yours differs.
  • Run the cron as the same system user that owns the Magento files.
  • Test both commands once on staging before the campaign.
  • Cron has no year field, so remove the entries after the campaign or they will fire again next year.
Always chain the cache clean command right after config:set in the same cron line, so the new homepage appears immediately and not at the next cache refresh.
On Adobe Commerce, Content Staging lets you schedule CMS page updates from the admin. On Magento Open Source there is no native scheduler for the homepage, which is why the CLI and cron approach is the usual solution.

Step 8: Protect your SEO during the swap

A homepage swap is safe when you keep the signals stable.

  • Keep the same Meta Title core and brand name, so rankings do not wobble.
  • Keep the main h1 meaningful, with one heading per page.
  • Keep important internal links to top categories in the seasonal layout.
  • Remember that the campaign page is also reachable at its own URL. Avoid linking to that URL from anywhere, and use the base URL in all campaigns and ads.

After the campaign, keep the seasonal page for next year instead of deleting it. Just update the content before it goes live again.

Step 9: Roll back and review

When the campaign ends:

  • Switch CMS Home Page back to your regular page.
  • Flush the cache and confirm the old homepage is back.
  • Leave the seasonal page enabled but unlinked, or disable it only after the switch back.
  • Note the dates and the URL keys in your team documentation.
Disable the seasonal page only after the homepage setting points back to the regular page, never before, or visitors will get a 404 on /.

Checklist

  • ☐ Seasonal CMS page created with a unique URL Key
  • ☐ Correct Store View selected on the page
  • ☐ Shared blocks reused instead of duplicated content
  • ☐ Page tested on desktop and mobile through its own URL
  • ☐ CMS Home Page changed in the right scope
  • ☐ Cache and CDN flushed after the change
  • ☐ Start and end commands tested on staging
  • ☐ Cron entries added, then removed after the campaign
  • ☐ Rollback verified in a private window

Common mistakes

  • The old homepage still shows after saving. The full page cache was not cleared. Run bin/magento cache:clean config full_page and purge the CDN.
  • The setting is greyed out. You are in a scope that inherits the value. Uncheck Use Default or switch to the correct store view.
  • The homepage returns a 404. The assigned page was disabled, deleted or not assigned to that store view. Re-enable it or choose another page.
  • The cron changes the wrong store. The --scope-code is missing or wrong. Check the store view code under Stores›All Stores.
  • Visitors land on a redirect. A redirect was added for /. Remove it and use the CMS Home Page setting.
  • The campaign repeats next year by accident. The yearly cron entries were left in place. Remove them after the campaign.

FAQ

Can I use a different homepage for each store view?

Yes. Set CMS Home Page at store view scope. Each view can use its own page, for example for different languages or countries.

Does changing the homepage hurt my SEO?

Not if you keep the title, heading and main internal links stable. The URL stays the base address, so there is no redirect and no link equity loss.

Can I schedule the change from the admin on Magento Open Source?

There is no native scheduler for the homepage setting in Open Source. Use the CLI and cron approach from this guide, or a dedicated extension.

Do I need to reindex after switching?

No. The homepage is a CMS page and a config value. Only the cache needs to be cleaned.

A faster alternative

The native method works well, but it relies on CLI access, cron and careful cache handling every time a campaign changes. If you would rather manage this from the admin with rules instead of scripts, take a look at Auto Switch Home, a Magento 2 module that changes the homepage automatically. It is optional, so use whichever approach fits your team.

Questions & Answers

No questions yet — be the first to ask.

Ask a question

Public. Shown only after moderation. No spam.

New guides, when they go live

One hands-on Magento 2 guide per email, only when we publish one. Nothing else.

Articles are written in English. One click to unsubscribe, in every email. · privacy