Most advice I see on redesigning a live site with Oxygen is to create a completely separate staging site, as you would typically.
However Oxygen is quite unique. With Oxygen installed, the plugin overides not only the previous theme, but the content as well. This means you can recreate your entire site with your new design and content on the same pages with Oxygen.
The way to do this is to enable Oxygen only for yourself for development (you will see Oxygen frontend and backend when logged in) and all logged out users will see the current version of the site and Oxygen will be completely invisible to them. This is done by uploading a php file (shown below). Then when you are ready to go live, simply remove that php file so that everyone sees the new version.
Please note that the standard way of redesigning a site with a staging site may be more appropriate in certain situations, such as if you are changing the plugins or functionality of your site. You will need to consider which is the best approach based on what changes you will be making.
Here is how to do it:
- Create a folder in your wp-content folder called mu-plugins
- Then in your mu-plugins folder create a php file called enable-oxygen-logged-in.php with this code below:
<?php
add_filter( 'option_active_plugins', 'enable_oxygen_logged_in' );
function enable_oxygen_logged_in( $plugins ) {
require (ABSPATH . WPINC . '/pluggable.php');
if ( !is_user_logged_in() ) {
$plugins_not_needed = array ('oxygen/functions.php');
foreach ( $plugins_not_needed as $plugin ) {
$key = array_search( $plugin, $plugins );
if ( false !== $key ) {
unset( $plugins[ $key ] );
}
}
}
return $plugins;
}
?>
Thats it!
The only issue I have come across is that if you are using FluentSMTP, the above code will prevent SMTP from working properly since both are using pluggable.php which causes a conflict. This is a known documented issue with FluentSMTP. In this case, the above code will work if you change to another SMTP plugin such as WP Mail SMTP by Wpforms (see Ian’s comment below – thanks Ian)
Do you need any other help with Oxygen? Contact us
Feel free to leave a comment below on your thoughts on this and if it worked for you.
Just did it – I’ll let you know how it works!
Sue
It worked like a charm!
Thanks,
Sue
Great! Good to know this helped Sue.
I created the PHP file in mu-plugins but it changes for the public side of the site not just for the one admin I placed in the file. On a tablet I checked the front end of the site and it showed the new oxygen rebuilding site not the original.
Hard to know why this is the case without taking a look.
It allows non-logged-in users to view the old site normally, which is great. However, we are using Oxygen 1. We see the “Edit in visual Editor” button, but when we click it, none of the builder tools show and we are still getting the divi sidebar with no way to actually use Oxygen to build new pages.
Sounds like you are currently with Divi and want to setup your new site with Oxygen. I would recommend creating your new site with Oxygen 2, not Oxygen 1. See if that works.
I am trying this for on Oxygen 3.0 but its not working.
I made a fix, please copy that code and try again.
Hey for the first time.i installed oxygen builder on my existing WordPress blog, suddenly my theme css broken and SEO plugin shows heading template has been changed..
Will above solution fix it?
Yes it should.
Hi, thanks for the tip! Everything worked, except that with Elementor installed the slug on the Oxygen editor screen shows:
“https://welltraveledmile.com/?elementor_library=card-maximizer-header-footer&ct_builder=true”
Is this an issue or will the elementor_library part be removed when I turn deactivate Elementor and delete the mu-plugin?
Thanks!
I never did this with a Elementor site. Was it an issue in the end?
Hi, just followed your advise but once I upload the file in the directory mu-plugins the site shows ERROR 500 – Internal Server Error! I use the new Oxygen 3.6 and Astra theme. Any advise? Regards
I just tested it with Oxygen 3.6 and Astra theme and it works for me.
It not working with my site. It appear white plain site with image. Like it doesn’t load a css but more terrible
Oxygen by default is a blank slate. It starts with a blank screen.
I will definetly give this a try. I didn’t really want to create a staging site. Thanks a lot, and congrats for the great content and for keeping the code up to date!
Ok, pls respond with how it went.
I am having issues, the code works perfectly but the problem is that by including pluggable.php it hooks wp_mail which in turn causes problems with Fluent SMTP / Postman SMTP.
Do you have any idea how to fix it?
The idea is awesome, I just need a solution for that.
Hi Ian, thanks for your feedback. Do you see any error displaying ?
The FluentSMTP plugin depends on wp_mail pluggable function and plugin is not able to extend it. Please check if another plugin is using this and disable it for FluentSMTP to work!
Possible Conflict: F:\laragon\www\wp-includes\pluggable.php:182
It happens both on Localhost and on a live website (which is the one I want to edit).
I changed the If condition to (if ($current_user->ID == 475) but this also happens if I just use the code exactly as you posted it.
Looks like this is a known issue: https://github.com/WPManageNinja/fluent-smtp/issues/10
I can recommend trying another SMTP plugin. I usually use WP MAIL SMTP BY WPFORMS (im not sure if it uses pluggable, but it has a good reputation generally). And there are many others you can try. I think it is worth the effort – in order to get it all to work.
That worked. I thought no other SMTP plugins would work, since I had also tried Postman SMTP and it gave me the same error.
It works great and it’s very useful, thank you!
Great! I’m happy you got it to work.
Sadly, it didn´t work for my page. I will try again.
OK. Now it worked! Many thanks!
Great! Thanks for your feedback.
Just wanted to comment about how valuable this is to anyone with an existing site that want’s to make changes non-destructively! I modified to filter for just me: if (is_user_logged_in() && get_current_user_id() === 1) and it works wonderful!
This should be part of the Oxygen Builder suite so newbies can use it. Reach out to them and maybe they will expand upon this in their code to make it easier for everyone switching.
Thanks again!!
Thanks for your feedback and also your suggested modified code.