WordPress: Difference between revisions

imported>Onny
Add section on security hardening
imported>Onny
Add example on using wp-cli
Line 157: Line 157:
};
};
</syntaxHighlight>
</syntaxHighlight>
=== Using wp-cli ===
wp-cli is a command line tool to configure and manage Wordpress instances. The following example command creates a administration account with the name <code>test</code> and the password <code>test123</code>
udo -u wordpress HOME=/var/lib/wordpress/example.org nix run nixpkgs#wp-cli -- --path=/nix/store/wxzcmjfkyk5nfk7vidzbz1mz28wnfl5b-wordpress-example.org-6.1.1/share/wordpress user create test test@example.org --role=administrator --user_pass=test123
</syntaxHighlight>
Change the home directory <code>/var/lib/wordpress/example.org</code> according to your instance domain name. The Wordpress root directory is specified with <code>--path</code> and can be found in the generated web server configuration.


== Tips and tricks ==
== Tips and tricks ==