• Resolved fedeltamedia

    (@fedeltamedia)


    When using WP Migrate, to migrate a production site to a staging website. The Wordfence Central keeps reporting “Wordfence Central Alert: 1 scan findings on site https://mydomain.com “.

    Even though the the website is actually located at https://staging.mydomain.com.

    I think there COULD be several solutions to this, sorted from best to worst:
    1. Can I programmatically disable Wordfence Central? I don’t need it on staging. But I do like to keep the Wordfence plugin for added security.
    Is there a hook or a filter I can call?

    add_action( 'init', function(){
    if( $_SERVER['SERVER_NAME'] == 'staging.mydomain.com' ){

    // code to deactivate Wordfence Central here
    }
    }, 99 );


    2. How do I force the Wordfence Central URL to change?
    3. Last resort would be to add Wordfence to above code using:
    deactivate_plugins('wordfence/wordfence.php');

    • This topic was modified 9 months, 2 weeks ago by fedeltamedia.
    • This topic was modified 9 months, 2 weeks ago by fedeltamedia.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @fedeltamedia, thanks for reaching out to us!

    Central will remain connected to a cloned site if the original was to begin with. The reason for this is to not disconnect customers using different domains to serve the same site.

    I would disconnect the staging site, and then disconnect/reconnect the live site as an immediate solution. Understandably, this isn’t ideal if you often clone your site(s), but if possible, skip the?wp_wfconfig?table when cloning. Then leave the staging site’s existing?wp_wfconfig?table in place, or export a copy of this table while the staging site is disconnected and import on staging again after refreshing the staging site. That may be easier than reconnecting.

    We do have a planned improvement to this process to include an option to only disconnect the staging site locally, without telling Central.

    Thanks,
    Peter.

    Thread Starter fedeltamedia

    (@fedeltamedia)

    Amazing, seems like a good workaround. I will try this, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wordfence Central uses production URL on staging after migration’ is closed to new replies.