0

I am trying to run Wordpress 4.7.0 inside a docker container but the auto-update pushes me to 4.7.3. Now, I am aware that to stop auto updates I'd need to append the wp-config.php file in the back-end, but to do that, i'd need to mount the container and the directory where wp-config.php resides, but I am not completely sure how or if it's even possible.

I figured another way would be to figure out the IP's that WP talks to for updates, and block it with iptables on the VM to avoid auto-update.

What're the IP's to block to stop WP from auto-updating?

  • Please accept the answer in case it worked for you.. – BlueSuiter Apr 27 '17 at 17:18
1

You don't need to block the IP address at all.

Append this code in wp-config.php of your website in case you have access to it::

define('WP_AUTO_UPDATE_CORE', false);

Alternative Method This will hide update messages for all kind of users::

Add this function to your functions.php

function hide_update_notice_to_all_but_admin_users()
{
    if (current_user_can('read')) {
        remove_action( 'admin_notices', 'update_nag', 3 );
    }
}
add_action('admin_head', 'hide_update_notice_to_all_but_admin_users', 1);
  • I have no access to wp-config.php because it's inside a docker container – heisenberg Apr 27 '17 at 17:23
  • @heisenberg Please recall the updated answer.. – BlueSuiter Apr 27 '17 at 17:38
  • @heisenberg Please click on the tick mark under the up-vote button, if you accepted as your answer. – BlueSuiter Apr 27 '17 at 19:15
  • Did not solve my problem, sorry. I can't mount from container to host, only vise-versa. How can I access functions.php or wp-config.php on a wordpress install inside a docker container? – heisenberg Apr 27 '17 at 20:00
  • Do you have the access to wp-admin?? – BlueSuiter Apr 28 '17 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.