Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active May 12, 2020 23:51
Show Gist options
  • Save dwayne/7983631 to your computer and use it in GitHub Desktop.
Save dwayne/7983631 to your computer and use it in GitHub Desktop.
WordPress notes.

Downloading WordPress via the Browser

  1. Navigate to http://wordpress.org/.
  2. Click on the download button. You would be taken to the download page, http://wordpress.org/download/.
  3. Download one of the compressed files, http://wordpress.org/latest.zip or http://wordpress.org/latest.tar.gz.

Installing via the Command Line

Setup project directory

$ mkdir -p new-project/public && cd new-project/public

Download

$ wget http://wordpress.org/latest.tar.gz

Unpack

$ tar -xzf latest.tar.gz

Install

$ mv wordpress/* .

Cleanup

$ rm latest.tar.gz && rm -rf wordpress

We can automate the installation in several ways:

  1. Using an alias
  2. Writing a shell script
  3. Using wp-cli

If you want to use an alias, then you can put the following in your .bashrc file: alias wpinstall="wget http://wordpress.org/latest.tar.gz && tar -xzf latest.tar.gz && mv wordpress/* . && rm latest.tar.gz && rm -rf wordpress".

Otherwise,

#!/bin/bash -e

echo "============================================"
echo "A robot is now installing WordPress for you."
echo "============================================"

# Download and unpack
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz

# Install
mv wordpress/* .

# Cleanup
rm latest.tar.gz && rm -rf wordpress

echo "========================="
echo "Installation is complete."
echo "========================="

To use wp-cli check it out here. Once installed, you could do the following:

$ wp core download
#!/bin/bash -e
echo "============================================"
echo "A robot is now installing WordPress for you."
echo "============================================"
# Download and unpack
wget http://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
# Install
mv wordpress/* .
# Cleanup
rm latest.tar.gz && rm -rf wordpress
echo "========================="
echo "Installation is complete."
echo "========================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment