Skip to content

Instantly share code, notes, and snippets.

@yuyokk
yuyokk / fix-wp-files-permissions.sh
Last active August 29, 2015 14:25
Set correct files and folders permissions for a wordpress site
cd /Applications/MAMP/htdocs/your-site-root
# set 755 permissions for all dirs
find . -type d -exec chmod 755 {} \;
# and 644 for files
find . -type f -exec chmod 644 {} \;
@yuyokk
yuyokk / update-wp-site-url.sql
Created July 11, 2015 22:39
Update wordpress site url
UPDATE wp_options
SET option_value = 'http://new-domain.com'
WHERE option_name = 'home';
UPDATE wp_options
SET option_value = 'http://new-domain.com'
WHERE option_name = 'siteurl';
UPDATE wp_posts
SET post_content = REPLACE(post_content, 'http://old-domain.com', 'http://new-domain.com');