Hello everybody,
I have per day around 10,000 visitors on my blog. Few days back I started to developing new wordpress theme into my blog but 'Theme Test Drive' plugin isn't working for me because you know well some WordPress general setting disturbing and also template selection etc... I need some solution to develop theme safely and while visitors use the default one.

Kindly help me,
Thank you!

Dani AI

Generated

Good starting points from and — they point you toward the right idea (an isolated testing environment). Below is a compact, practical workflow plus a small, reliable code-based alternative to Theme Test Drive so only you (or other admins) see the new theme while visitors continue to see the current live theme.

Set up a proper staging site (local, subdomain or a separate host) that uses its own database and credentials. Export the live database, import it into staging, and run a URL search/replace so routes match the staging domain. Keep staging protected (HTTP auth or IP restriction), disable caches/CDN on staging, and put theme code under version control (Git) so you can deploy changes safely. This keeps your editors free to update content on the live site without interfering with your work, and makes rolling back trivial because the live DB and the staging DB are independent.

If you need visitors to keep the old theme on the live site while admins preview the new theme, add a small filter (only on the site where you want the split view). Drop this into a tiny plugin or the staging functions file — do not leave it on a public live environment without considering caching/security:

function preview_theme_for_admins( $theme ) {
  if ( is_admin() ) return $theme;
  if ( current_user_can( 'edit_theme_options' ) ) {
    return 'your-new-theme-folder'; // replace with new theme directory name
  }
  return $theme;
}
add_filter( 'stylesheet', 'preview_theme_for_admins', 100 );
add_filter( 'template', 'preview_theme_for_admins', 100 );

Notes and cautions: clear/disable page caching and CDN for any split-theme testing so cached HTML doesn’t leak the wrong template to visitors. Never run the above on a public site without HTTP auth or noindex headers if you don’t want search engines indexing the staging view. Always back up files and DB before deploying theme changes to production.

Recommended Answers

All 4 Replies

Dear Chinmay, if you want to modify the code or test new codes on wordpress, you can copy the folder that contain all the wordpress files and paste it anywhere you want in public_html folder .. name it something that no one can guess it (you can protect it with password from an option in the cpanel).
So when you do those steps .. you will have the same live activities running on your test wordpress blog. You can now change, add or remove any part of the website code without changing the original wordpress blog code.
NB: Don't delete or edit posts, articles because this will affect the original wordpress too since both are connected to the same database.

Thank you for reply. I am really very glad. I have one more question, respected 'amirbwb' you are correct but I have few employees working in my blog and daily basis updating new posts and changing... and you're saying, "Don't delete or edit posts, articles because this will affect the original wordpress too since both are connected to the same database." NOW? WHAT SHOULD I DO SIR?

Dear "Chinmay",

"Don't delete or edit posts, articles because this will affect the original wordpress too since both are connected to the same database." NOW? WHAT SHOULD I DO SIR?

I actually mean that if you modify an article or delete from the Test wordpress blog (not the original one), this will be also applied on the original blog since the source of information/data is the same.

So the point is just to be aware not to publish a RANDOM ARTICLE for testing because it will appear on the original WP blog.

However, modifying, adding, deleting codes in the Test WP blog will not affect the original WP blog.

Hope I was clear :) for any other information please feel free to ask :)

This is good advice by amir. Usually I'll just create a separate directory and make a new WP installation there. Or I'll make a new subdomain for testing. Then you can use htpasswd with .htaccess to protect the directory. If you want you can create a new database for this new installation. WordPress has Import/Export tools so you can just copy all your entries over to a new installation. Note you may have to manually update is other settings (General, Reading, Writing, Permalinks, etc...) and plugins.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.