Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

The tag has no usage guidance.

1
vote
1answer
168 views

Shortest way to install WP-CLI

That's the shortest way I know to install the WordPress shell extension WP-CLI: curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > /usr/local/bin/wp && chmod +...
2
votes
2answers
229 views

How to disable XML-RPC from Linux command-line in a total way?

I read near the end of this guide regarding utilizing SSHguard to protect WordPress from Brute force attacks that after configuring SSHguard the relevant way, one must: disable XML-RPC by blocking ...
0
votes
2answers
127 views

How can I list all installed plugins/themes/versions from CLI/API?

I would like to generate a simple text report for a Wordpress instance listing: Wordpress version plugins installed (version and whether enabled) themes and child themes installed (version and ...
0
votes
2answers
670 views

How can I use PurifyCSS to clean WordPress style.css?

I am trying to use PurifyCSS to clean my style.css file. When I try it on static html file if works fine. See example of my CLI command: purifycss wp01/wp-content/themes/mytheme/style.css index.html -...
1
vote
0answers
69 views

Other than WP-CLI, is there a way to install Wordpress via the command-line?

I've been trying to create an Ansible playbook to install Wordpress. Most of the online documentation I've read, about installing Wordpress via the command-line points to WP-CLI. Question is, aside ...
1
vote
1answer
170 views

Error updating WP-CLI

Below is the output from my attempt to update wp-cli on Windows 10. Clearly another version is available. Can someone please explain how to make this work? C:\Users\HP>wp cli update Error: You can ...
0
votes
2answers
170 views

wp-cli for Creating page-template

I've recently started using wp-cli to work on WordPress and starting to love it. However, I'm curious about creating page templates using wp-cli. I haven't been able to find anything on it, does ...
3
votes
1answer
239 views

Generate WP-CLI @alias for each site on multisite

I have a few multisites, each with several sites, that I want to auto-generate @aliases for. Is there way to sync those sites as aliases in my site list? I'd like to be able to target a single site ...
0
votes
2answers
216 views

Running custom defined WP-CLI commands without Wordpress installation present

I have registered custom commands that scaffording some files. These commands don't rely on any wordpress funcionality, basically outputs some files with content (what commands do is irrelevant in ...
5
votes
1answer
755 views

Where/how are categories stored?

Disclaimer: I am new to WordPress. When I add categories to my blogging site, where/how are these categories stored? If I want to change the names of these categories in batch, without having to go ...
0
votes
1answer
725 views

Avoid 'uploads' 777 permissions: Potential threat or clean solution?

Recently changed hosting of a website and found the upload directory of WordPress wasn't "available". I have been reading that setting folder permissions to 777 would allow everything to work fine, ...
1
vote
2answers
2k views

How to run a php file that uses wordpress functions from command line?

I am using wordpress functions in a custom php file including wp-load.php, run from browser it is fine, but run from command line with php /path/.php wp-load.php causes problems: Warning: Cannot ...
1
vote
2answers
837 views

How do I set and list page_template with wpcli?

I have a page that has a new template, and I want to set that new template with wp-cli. When I wp post get <id> I get an output like the following: +-----------------------+--------------------...
0
votes
1answer
39 views

Trigger function without awaiting response?

I'm running an e-commerce solution for a client and have to upload a .txt file to an FTP for each order. I need to trigger the function I wrote to do this every time an order comes in, but I'm not ...
0
votes
1answer
2k views

Change Wordpress URL in sql file via Terminal

I've got a 40mb database file that I've exported from an old host and need to import it into a new host on a new domain. I normally open up the database in my code editor and find-replace, but as this ...
4
votes
1answer
2k views

Is it possible to export WordPress from command line?

Is it possible to export WordPress from command line? I don't mean use mysqldump to export the database, but create the xml file used to easily import to another WordPress installation.
4
votes
1answer
2k views

How do I delete all generated images from my server except those currently used in posts

I have a new set of image sizes for my site's in-development theme. My server is filled with old image sizes, most of which have never been used. You've heard this one before, right? The Question How ...
0
votes
2answers
947 views

Database Update Required - Update from command-line

I just did upgrade my wordpress subtree of my website to the 3.6 branch and now the site tells me that I need to upgrade my database as well: Database Update Required Nothing special so far, just ...
3
votes
2answers
1k views

How do I pass an array as an argument to a WP-CLI command?

I want to use WP-CLI to create some new posts with custom taxonomy terms assigned. The challenge is that wp_insert_post's tax_input argument only accepts arrays, which I would have to specify on the ...
3
votes
3answers
5k views

wp-cli displays php notices when display errors off

I am using wp-cli and I am having php notices and errors show up when running wp-export. Some of these warnings and errors are ending up in the output file. How can I force errors to NOT show up. I ...
-1
votes
1answer
1k views

Why can't the WP-CLI installer find my php.ini?

I am trying to install WP-CLI on my Mac using the standard installation command (found here: http://wp-cli.org), yet I am receiving the following error message: #!/usr/bin/env php Some ...
22
votes
2answers
13k views

Initialize WordPress environment to use in command line script

I have a command line script for maintaining a wordpress plugin and have to load the wordpress core to be able to access wordpress functions. This problem is very similar to Initialize WordPress ...
2
votes
1answer
3k views

How to determine wordpress base path when wordpress core is not loaded

I have a command line script for maintaining a wordpress plugin and have to determine the wordpress base path to be able to load the wordpress core. I could just assume the script is several levels ...
5
votes
3answers
9k views

How To Export/Import WordPress (MySQL) Database Properly Via Command-Line?

Normally, a MySQL database can be exported and imported using these simple SSH commands: Export: mysqldump -u USERNAME -p DATABASE_NAME > filename.sql Import: mysql -u USERNAME -p DATABASE_NAME ...
5
votes
3answers
2k views

How to use command 'wp post create' in wp-cli properly?

I need to create a single post with title, content and excerpt with this command as it's described in the utility documentation. Could you please show me an example of how to use it? I couldn't find ...
8
votes
2answers
1k views

Running WordPress on the Command Line - Turn off Delayed Output?

I'm creating a cron job that runs outside of WordPress. From a development perspective, this makes it really easy to debug and create cleanup scripts or cron jobs, by just running a command like the ...
1
vote
1answer
5k views

Run W3 Total Cache Flush Function with Crontab [closed]

Ok. I'm really stumped on this one. Basically, I need to call a function for the Wordpress plugin W3 Total Cache as part of a cron job in crontab. I'd like to automatically clear the entire page ...
0
votes
2answers
760 views

Get plugin download URL from slug

Is there a way to take a plugin slug (e.g. 'akismet') of a plugin that is NOT currently installed and somehow retrieve the download URL of the current version (e.g. 'http://downloads.wordpress.org/...
2
votes
2answers
3k views

Initialize WordPress environment to use in a real cron script

I have to run a PHP script through real cron (WP cron being too unreliable). Within that script, I need $wpdb to insert data into WordPress table. But of course $wpdb will not be available as ...
2
votes
1answer
76 views

Do you have to have command line access to use Subversion with Wordpress?

My group does not have command line access to the machine that is running our WordPress instance. However, we would still like to install/update using Subversion. Is this possible? Also, does ...
12
votes
4answers
5k views

Access WordPress API Outside of WordPress (command-line PHP)

I have a PHP script that I need to run as a cron job. However this script needs access to the WP API (get_pages(), get_post_meta() and get_permalink() specifically). I've followed the instructions ...
10
votes
6answers
19k views

Determining WordPress' Version from the Host's Command Line?

Given that I can't access the dashboard/admin pages on my blog (that's a future question), and that I have shell access to my hosting server, can I find out the current version of WordPress from the ...