Mar
17
2016
17
2016
Query WordPress Database for Invalid Media Filenames
WordPress for some reason didn’t use to filter out invalid file names on upload, causing some interesting issues with charsets and rendering (specifically images not loading in browsers). Using the following queries, you can easily find those items with invalid filenames, and their associated posts (which unfortunately means you’ll still have to replace them)… SELECT ID, post_title, post_content, post_parent, guid FROM wp_posts WHERE post_type = ‘attachment’ AND `post_status` = ‘inherit’ AND (guid LIKE ‘%.jpg’ OR […]
Jun
9
2013
9
2013
Find and replace in MySQL
UPDATE yourtable SET this_field = REPLACE(this_field, ‘replace me’, ‘replacement value’);
Recent Snippets
- htaccess : Only allow access to specific wordpress upload types if logged in
- MySQL : Query WordPress Database for Invalid Media Filenames
- PHP : Get Actual IP Address with PHP
- JavaScript : Allow Tab in Textarea
- PHP : Clean sanitized database contents on output
- htaccess : Force www. prefix in URIs
- PHP : Force File Download with Correct Content Type
- Wordpress : Disable upgrade notification