Closed macolo closed 5 years ago
turns out this is super easy. Here is an example in ansible with wp-cli:
# protect stage
- name: configure password protect plugin to protect stage environments
command: "{{ item }}"
args:
chdir: "{{ project_root }}/wordpress/"
with_items:
- wp option update password_protected_status 1
- wp option update password_protected_feeds 1
- wp option update password_protected_rest 1
- wp option update password_protected_administrators 1
- wp option update password_protected_users 1
- wp option update password_protected_password e4b686c6678333jakfj390sfjdf7493a3ec9 # password is 'password'
- wp option update password_protected_remember_me 1
- wp option update password_protected_remember_me_lifetime 60
become_user: www-data
when: not wp_blog_public
It would be great to be able to set the password and other plugin settings programmatically.
For example via wp-cli or just via php on the command line.
Use Case: Deploy scripts should be able to install the password protect plugin and then also configure it.