Set Up WordPress Staging on Hostinger and Push Changes

by Fahim

We’ve all been there: you update a plugin directly on production, watch the loading spinner hang, and get hit with a 500 error while customers are actively checking out. Setting up staging isn’t optional if you care about uptime. Here is how I configure an isolated WordPress staging environment on Hostinger, test updates safely, and push changes back to production without wiping out live store orders or new comments.

Setting up a WordPress staging environment and pushing code to live on Hostinger
Setting up a WordPress staging environment and pushing code to live on Hostinger

Hostinger Staging Tool vs Manual Subdomains

Hostinger includes a built-in staging manager on Business Web Hosting and Cloud tiers. It clones your site onto an auto-generated subdomain, spins up an independent MySQL database, and hooks it into a one-click deployment engine. If your plan supports it, use it—it cuts out 20 minutes of tedious manual cloning.

On Single or Premium plans, hPanel grays out the native staging tool. If you’re on those tiers, you can build the exact same setup manually: spin up a subdomain (like dev.yourdomain.com), copy your files over, dump and

One critical thing to remember: staging takes a frozen snapshot of your site at that exact moment. Anything that changes on live while you’re tinkering on staging won’t exist in your staging branch.

Step 1: Spin Up the Staging Clone in hPanel

Log into hPanel and open your website dashboard. Under the WordPress section in the left sidebar, click Staging.

  1. Click the purple Create Staging button.
  2. Give it a subdomain name. I stick to something predictable like staging so the test site resolves at staging.yourdomain.com.
  3. Click Create.

Give it roughly 45 to 90 seconds. Behind the scenes, Hostinger copies your entire public_html tree to a separate directory, provisions a fresh database, updates wp-config.php with new credentials, and executes a database search-and-replace so internal links resolve to the subdomain.

When it finishes, your staging instance will show up in the table with its own direct WordPress admin link and a Publish button.

Step 2: Lock Down Staging from Search Engines and Public Traffic

Don’t skip this step. If Google indexes your staging subdomain, you risk duplicate content penalties, and confused visitors might stumble across broken test layouts or dummy checkout pages.

Hostinger automatically toggles “Discourage search engines from indexing this site” in WordPress reading settings, but web crawlers can—and often do—ignore that header. The only reliable way to keep bots and the public out is adding HTTP Basic Authentication right in your .htaccess file.

Open File Manager in hPanel, browse to your staging folder (usually /domains/yourdomain.com/public_html/staging), and place this block at the very top of your .htaccess file:

AuthType Basic
AuthName "Staging Area"
AuthUserFile /home/u123456789/domains/yourdomain.com/public_html/staging/.htpasswd
Require valid-user

If you hit strange 403 errors or infinite redirect loops after updating this file, check our guide on how to fix root .htaccess inheritance on Hostinger subdomains to prevent parent directory rules from clobbering your staging configuration.

Step 3: Enable Debugging and Run Your Tests

Log into your staging admin panel and break things. This is where you test PHP version bumps, trial major plugin updates, tweak CSS, or rebuild page templates without risking live revenue.

Don’t just click through a few pages and assume everything works because nothing visibly crashed. Turn on WordPress debug logging in your staging site’s wp-config.php so PHP warnings, deprecated functions, and silent background failures get caught in a log file.

Paste these definitions right above the /* That's all, stop editing! */ line:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Run your tests, submit test forms or checkouts, and check out the official WordPress debugging documentation if you start seeing fatal errors piling up inside /wp-content/debug.log.

What I Ran: The Dangerous Live Database Gotcha

Here is the trap that catches almost everyone the first time they use one-click staging: Hostinger’s native publish feature performs a full database overwrite.

When you hit “Publish” in hPanel, Hostinger overwrites your production database with your staging database. If your site is a static portfolio or simple brochure site where no dynamic content has been generated since you clicked “Create Staging”, that’s totally fine.

However, if you run a WooCommerce store, a membership site, an active forum, or a blog receiving daily comments, you will destroy live data. Any order placed on the live site while you spent three hours tinkering on staging will be wiped out when staging overwrites production.

I learned this the hard way during a WooCommerce site rebuild when two customer orders vanished after what should have been a quick CSS deployment. If your live site processes transactions, you have two options:

  • Put the live site into Maintenance Mode right before creating the clone, test fast, and push back before reopening.
  • Use selective file sync via SSH/Git and avoid pushing the staging database back to production at all.

Step 4: Push Changes to Live via hPanel

If your site content is static and you’re ready to publish using Hostinger’s automatic mechanism, follow these steps:

  1. In hPanel, navigate back to WordPress > Staging.
  2. Find your staging row and click Publish.
  3. A modal will confirm that the system will automatically generate a full backup of your production site before proceeding.
  4. Confirm the prompt to execute the deployment.

Hostinger swaps your staging files into production public_html, imports the staging database into production, and runs an automated search-and-replace to rewrite staging.yourdomain.com back to your primary domain.

For more details on Hostinger’s snapshot triggers and backup retention, check the Hostinger staging environment guide.

Step 5: Selective Code Deployments (For Dynamic & Store Sites)

If you’re running an active store, do not hit the hPanel “Publish” button. Instead, push only your theme and plugin code changes, leaving the live database completely untouched.

The cleanest way to do this without messing around in slow FTP clients is over SSH using rsync.

Connect to your Hostinger server over SSH, navigate to your staging root, and sync your modified custom theme directly into production:

rsync -avz --exclude 'node_modules' --exclude '.git' 
/home/u123456789/domains/yourdomain.com/public_html/staging/wp-content/themes/my-custom-theme/ 
/home/u123456789/domains/yourdomain.com/public_html/wp-content/themes/my-custom-theme/

If you prefer an automated workflow instead of running terminal syncs manually, read our tutorial on how to set up Git auto-deployment for WordPress in Hostinger so your GitHub commits deploy straight to production.

If you ever have to manually sync specific database tables between environments without blowing away orders, refer to our walkthrough on how to safely update WordPress URLs with WP-CLI search-replace according to the WP-CLI handbook.

Post-Push Sanity Checklist

Whether you clicked Publish or synced via rsync, run through this four-point sanity check immediately:

  • Purge Object and Page Caching: Head to hPanel > WordPress > Dashboard and click Purge All. Stale LiteSpeed cache is the number one reason layouts look broken right after a deployment.
  • Re-save Permalinks: Log into your live WordPress dashboard, go to Settings > Permalinks, and click Save Changes without modifying any settings. This regenerates the rewrite rules in your live .htaccess and prevents sudden 404s on subpages.
  • Verify Search Engine Visibility: Go to Settings > Reading on your live site. Make sure “Discourage search engines from indexing this site” is unchecked. Hostinger’s automation usually unchecks this, but double-check anyway—I’ve seen it stay locked.
  • Check Elementor and Page Builder Asset Paths: If you use page builders, open their tools menu and regenerate CSS files so compiled stylesheets aren’t still referencing staging paths.

Frequently Asked Questions

Can I create more than one staging site on Hostinger?

No. Hostinger’s native staging tool allows one active staging environment per website at a time. If you need a second branch for another developer, you must delete your existing staging site from hPanel or configure a manual subdomain instance.

Does creating a staging site count against my disk space limit?

Yes. Staging creates a complete duplicate of your files, uploads folder, and database. If your live site occupies 12GB of storage, your staging environment will claim another 12GB, consuming 24GB of your overall plan allotment.

Will pushing from staging break my SSL certificate?

No. Hostinger assigns an automatic Let’s Encrypt wildcard SSL certificate to the staging subdomain when it is created. When pushing changes live, the production SSL certificate remains entirely untouched.

How do I delete a staging site when I am finished?

In hPanel, navigate to WordPress > Staging, click the three-dots menu icon next to your staging instance, and select Delete. This removes the staging folder and drops the staging database instantly without touching live files.

Next Steps

Now that your deployment workflow is separated from your live visitors, you can safely automate repetitive background tasks without degrading site performance. Check out our guide on how to replace WP-Cron with a Linux system cron on Hostinger to keep scheduled updates and background tasks running on a predictable schedule.

all_in_one_marketing_tool