WP-CLI Flashcards

1
Q

Q: What does WP-CLI stand for?

A

A: WordPress Command Line Interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: What is WP-CLI used for?

A

A: Managing WordPress sites via the command line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: How do you check the installed version of WP-CLI?

A

A: wp –version.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: What is the default file that WP-CLI uses for configuration?

A

A: wp-cli.yml.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: Where is the WP-CLI configuration file located by default?

A

A: In the root directory of your WordPress installation or the home directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: What is the official command to install WP-CLI?

A

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: How do you make WP-CLI globally executable?

A

chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: How can you verify WP-CLI installation?

A

A: Run wp –info.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: What PHP version is required for WP-CLI?

A

A: PHP 7.4 or higher (may vary with newer versions).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: How do you update WP-CLI?

A

A: wp cli update.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: What command lists all available WP-CLI commands?

A

A: wp help.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: How do you display help for a specific command?

A

A: wp help <command></command>.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: How do you view the current status of your WordPress site?

A

A: wp core status.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: What flag runs a command in quiet mode, suppressing output?

A

A: –quiet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: How do you execute a WP-CLI command in a specific WordPress installation directory?

A

A: wp –path=/path/to/wordpress <command></command>.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: How do you download the latest version of WordPress?

A

A: wp core download.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Q: How do you install WordPress with WP-CLI?

A

wp core install –url=”example.com” –title=”Site Title” –admin_user=”admin” –admin_password=”password” –admin_email=”email@example.com”

18
Q

Q: How do you update WordPress core?

A

A: wp core update.

19
Q

Q: How do you verify the integrity of WordPress core files?

A

A: wp core verify-checksums.

20
Q

Q: How do you check if a WordPress update is available?

A

A: wp core check-update.

21
Q

Q: How do you optimise a WordPress database?

A

A: wp db optimize.

22
Q

Q: How do you repair a WordPress database?

A

A: wp db repair.

23
Q

Q: How do you export a database with WP-CLI?

A

A: wp db export filename.sql.

24
Q

Q: How do you import a database with WP-CLI?

A

A: wp db import filename.sql.

25
Q

Q: What command allows you to execute raw SQL queries?

A

A: wp db query “<SQL>".</SQL>

26
Q

Q: How do you install a plugin with WP-CLI?

A

A: wp plugin install <plugin-slug>.</plugin-slug>

27
Q

Q: How do you activate a plugin?

A

A: wp plugin activate <plugin-slug>.</plugin-slug>

28
Q

Q: How do you deactivate a plugin?

A

A: wp plugin deactivate <plugin-slug>.</plugin-slug>

29
Q

Q: How do you list all installed plugins?

A

A: wp plugin list.

30
Q

Q: How do you update all plugins?

A

A: wp plugin update –all.

31
Q

Q: How do you install a theme using WP-CLI?

A

A: wp theme install <theme-slug>.</theme-slug>

32
Q

Q: How do you activate a theme?

A

A: wp theme activate <theme-slug>.</theme-slug>

33
Q

Q: How do you delete a theme?

A

A: wp theme delete <theme-slug>.</theme-slug>

34
Q

Q: How do you list all installed themes?

A

A: wp theme list.

35
Q

Q: How do you update all themes?

A

A: wp theme update –all.

36
Q

Q: How do you create a new user?

A

wp user create <username> <email> --role=<role></role></email></username>

37
Q

Q: How do you list all users?

A

A: wp user list.

38
Q

Q: How do you update a user’s password?

A

A: wp user update <user-id> --user_pass=<new-password>.</new-password></user-id>

39
Q

Q: How do you delete a user?

A

A: wp user delete <user-id>.</user-id>

40
Q

Q: How do you set the default role for new users?

A

A: wp option update default_role <role>.</role>