Accueil » Coding » Remove all special characters from your file names

So today we will see a trick HYPER simple but especially essential for the well being of your file uploads on WordPress :)!

This is a native function of WordPress that is very easily called thanks to the call of a filter in the file functions.php of our child theme:

add_filter('sanitize_file_name', 'remove_accents' );

And that’s all :D! And thanks to this simple line, ALL slightly exotic characters (é, è, à, space, etc.) will be converted into standard characters. So no more problems when FTP access to certain files or incompatibilities on some systems :).

I never understood why the WordPress development team did not add this processing natively when sending files 🙂 …

It is a must for each of the children themes that I create for the websites of my clients :).

And soon it will be for you too;) …

 

If you wish to help me to make this blog alive, you can make a donation, below :).

 

Après avoir visité les coulisses, découvrez le site :) !

Submit a Comment

Your email address will not be published. Required fields are marked *

Accueil » Coding » Remove all special characters from your file names
Share This