I use MainWP to help me manage my clients’ WordPress sites but recently was having some connectivity issues with some of the sites running Cloudflare. In the MainWP parent site I would connect to my client site and establish a connection but would immediately lose the connection upon sync. I could not reconnect to the child site unless I went in and disable the MainWP Child plugin then reactivated it. I could then connect to the site but would once again lose the connection if I tried to the sync the site. After some digging I found a solution and want to share it with my fellow MainWP people.
In order to fix this you must have access to the Cloudflare control panel on Cloudflare’s website. You will also need to know the IP address of your MainWP parent site.
First, let’s add your MainWP parent site’s IP address to the Cloudflare whitelist. This will keep your MainWP Parent site from getting blocked by the Cloudflare firewall. From the Cloudflare control panel click on the Firewall button and it will take you to the firewall page.
Next, scroll down the page until you see the the Access Rules section. Add a new rule and put your parent site’s IP address into the field and then from the dropdown choose “whitelist” for this website. Click add to apply the rule and whitelist your MainWP parent site’s IP address with Cloudflare.
Next, we are going to prevent Cloudflare from applying performance and security features to our admin area of the child site. This is what causes the site to disconnect from the parent site.
In Cloudflare navigate to the “Page Rules” area by clicking on the “Page Rules” button.
Scroll down and click on the “create page rule” button to setup your page rules. For the url area enter: http://www.yoursite.com/wp-admin/* but obviously replace the “yoursite.com” with your site’s url.
Next, click the “+Add a setting” link to add our first rule. From the dropdown choose “Disable Security” then add another rule and from the dropdown choose “Disable Performance”. Click Save and Deploy.
Now go back and try and reconnect to your child site. You should be able to connect and sync without Cloudflare blocking the connection!
Got any tips to help improve WordPress with Cloudflare? Leave em in the comments!Tags: Cloudflare, MainWP
Categorised in: MainWP
This post was written by moorewebx