Generate SQL queries for search and replace operations in MySQL databases. Common for WordPress migrations when changing domains or URLs.
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`, 'http://old-domain.com', 'https://new-domain.com') WHERE `option_value` LIKE '%http://old-domain.com%'; UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`, 'http://old-domain.com', 'https://new-domain.com') WHERE `post_content` LIKE '%http://old-domain.com%'; UPDATE `wp_posts` SET `guid` = REPLACE(`guid`, 'http://old-domain.com', 'https://new-domain.com') WHERE `guid` LIKE '%http://old-domain.com%'; UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`, 'http://old-domain.com', 'https://new-domain.com') WHERE `meta_value` LIKE '%http://old-domain.com%'; UPDATE `wp_usermeta` SET `meta_value` = REPLACE(`meta_value`, 'http://old-domain.com', 'https://new-domain.com') WHERE `meta_value` LIKE '%http://old-domain.com%'; UPDATE `wp_comments` SET `comment_content` = REPLACE(`comment_content`, 'http://old-domain.com', 'https://new-domain.com') WHERE `comment_content` LIKE '%http://old-domain.com%'; UPDATE `wp_comments` SET `comment_author_url` = REPLACE(`comment_author_url`, 'http://old-domain.com', 'https://new-domain.com') WHERE `comment_author_url` LIKE '%http://old-domain.com%';
wp search-replace 'http://old-domain.com' 'https://new-domain.com' --all-tables --dry-run # Remove --dry-run when ready to execute
Generate SQL queries to create WordPress admin accounts instantly. Useful when locked out or need quick database-level access.
Generate correct chmod and chown commands to fix WordPress file and folder permissions.
Generate Apache .htpasswd entries for basic authentication with MD5, SHA-1, or plain text hashing.