Replace non-english and weird characters in file name on upload in WordPress by adding this to your functions.php.
1 2 3 4 5 |
add_filter( 'sanitize_file_name', 'extended_sanitize_file_name', 10, 2 ); function extended_sanitize_file_name( $filename ) { $sanitized_filename = remove_accents( $filename ); return $sanitized_filename; } |
Updated. Credits goes to http://annalinneajohansson.com/2013/10/10/rensa-specialtecken-ur-filnamn-vid-uppladdning-i-wordpress/.