$ sudo rm -rf package-lock.json node_modules
$ sudo npm cache clean --force
$ npm install
wp cli is usually installed as just wp
, but sometimes you may find it called wp-cli
instead.
/path/to/wp-rocket-settings-backup.json
is the exported json file from wp-rocket. Replace with the path and file name of the json file on your server or cluster.
$ wp package install --allow-root wp-media/wp-rocket-cli:trunk
$ wp rocket import --file=/path/to/wp-rocket-settings-backup.json
To view disk usage via cli.
$ df -h --total
Example Output:
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 201M 23M 178M 12% /run
/dev/vda7 50G 39G 8.6G 82% /
Update all pages/posts to be index by google. This is a global update and will set all posts/pages to be indexed.
UI found in post/page in the Yoast SEO setction, under Advanced
Run this query in phpmyadmin, adminer, or what ever db client you are using.
UPDATE `wp_postmeta` SET `meta_value`='2' WHERE `meta_key`='_yoast_wpseo_meta-robots-noindex'
SELECT `guid`, `post_title` FROM `wp_posts` WHERE `post_content` LIKE '%[contact-form-7%'
Replace <ID HERE>
with the id number found in wp-admin
SELECT `guid`, `post_title` FROM `wp_posts` WHERE `post_content` LIKE '%[contact-form-7 id="<ID HERE>"%'
Yoink: https://stackoverflow.com/a/57484589
Thin 100
Extra Light 200
Light 300
Regular 400
Medium 500
Semi-Bold 600
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Insert code snippits to the <head> and <body> tags | |
// Useful for gtag and analytics | |
function insert_in_head() { | |
?> | |
<!-- Google Tag Manager --> | |
<!-- SCRIPT FOR GTAG --> | |
<!-- End Google Tag Manager --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Yoink: https://mekshq.com/which-wordpress-template-file-used/ | |
//For example, you can paste this into your theme functions.php file | |
function meks_which_template_is_loaded() { | |
if ( is_super_admin() ) { | |
global $template; | |
print_r( $template ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Yoink: https://wordpress.stackexchange.com/a/41300 | |
// Function to upload images from url to Wordpress | |
// then set the new image as a posts featured image via post ID | |
function Generate_Featured_Image( $image_url, $post_id ){ | |
$upload_dir = wp_upload_dir(); | |
$image_data = file_get_contents($image_url); | |
$filename = basename($image_url); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OG Yoink: https://stackoverflow.com/a/33855249 | |
# -g 8, was chosen based on this: https://docs.microsoft.com/en-us/windows/win32/wmformat/configuring-video-streams-for-seeking-performance?redirectedfrom=MSDN | |
ffmpeg -i input_video.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis -g 8 output_video.webm; |