5
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WP-CLIを使ったWordPressの新規構築

Posted at

概要

WP-CLIを使ったwordpressの構築をメモとして残しておく
新規構築の場合は下記のコマンドを一通り叩けば最低限の環境は揃うはずです

構築の流れ

WP-CLIのインストール

$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
$ chmod +x wp-cli.phar
$ sudo mv wp-cli.phar /usr/local/bin/wp

本体ダウンロード

$ wp core download --locale=ja --path=/var/www/wordpress

DB設定

$ wp core config --dbname=wp_sample --dbuser=root --dbhost=localhost --dbprefix=wp_

セットアップ

$ wp core install --url=http://wordpress.local/ --title=test --admin_user=admin --admin_password=admin1234 --admin_email=admin@example.com

プラグインのインストール・有効化

sampleとしてよく使われそうな2つを書いています

$ wp plugin install all-in-one-seo-pack --path=/var/www/html/wordpress  --activate
$ wp plugin install google-sitemap-generator --path=/var/www/html/wordpress  --activate

テーマ作成・有効化

$ wp scaffold child-theme twentysixteen-child --parent_theme=twentysixteen --path=/var/www/html/wordpress --activate

テーマの有効化

既存のテーマを利用したい場合はこちらのコマンドを利用すればOKです

$ wp theme activate twentysixteen-child --path=/var/www/html/wordpress
5
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?