↑ ↓ select, Enter open, Esc close

#wordpress

13 one-liners with this tag.

All one-liners tagged wordpress

Check the Redis Object Cache status in WordPress

$wp redis status --path=/var/www/vhosts/example.com/httpdocs
harmlessRedis and Memcached

Check WordPress core files for tampering

$wp core verify-checksums --path=/var/www/vhosts/example.com/httpdocs
harmlessWP-CLI

Count WordPress plugins by status

$wp plugin list --format=json --path=/var/www/vhosts/example.com/httpdocs | jq -r 'group_by(.status)[] | "\(.[0].status): \(length)"'
harmlessText processing

Find large images in wp-content/uploads

$find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.webp' \) -size +500k -printf '%s\t%p\n' | sort -rn | head -50 | numfmt --field=1 --to=iec
harmlessImages and performance

Find PHP files in the WordPress uploads folder

$find /var/www/vhosts/example.com/httpdocs/wp-content/uploads -type f \( -iname '*.php' -o -iname '*.phtml' -o -iname '*.php[0-9]' \) -ls
harmlessSecurity

Get the latest WordPress version from the API

$curl -s https://api.wordpress.org/core/version-check/1.7/ | jq -r '.offers[0].version'
harmlessText processing

List all WordPress installations in WP Toolkit

#plesk ext wp-toolkit --list
harmlessPlesk

Purge LiteSpeed Cache for a WordPress site with WP-CLI

$wp litespeed-purge all --path=/var/www/vhosts/example.com/httpdocs
cautionLiteSpeed

rsync with excluded directories and files

$rsync -av --exclude='wp-content/cache/' --exclude='*.log' /var/www/vhosts/example.com/httpdocs/ /backup/example.com/httpdocs/
cautionrsync and backup

Secure the permissions of wp-config.php

$chmod 600 /var/www/vhosts/example.com/httpdocs/wp-config.php
cautionPermissions and ownership

Set all directories to 755 recursively

$find /var/www/vhosts/example.com/httpdocs -type d -exec chmod 755 {} +
cautionPermissions and ownership

Set all files to 644 recursively

$find /var/www/vhosts/example.com/httpdocs -type f -exec chmod 644 {} +
cautionPermissions and ownership

Update WordPress core including the database

$wp core update --path=/var/www/vhosts/example.com/httpdocs && wp core update-db --path=/var/www/vhosts/example.com/httpdocs
cautionWP-CLI

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.