Wordpress - What is the best way to sanitize data?
Note that storing data safely is different from safe data. For example JavaScript code can be totally harmless in context of database security, but nightmare in context of front-end.
There is no single blanket approach, that is why WordPress has massive amount of related functions.
You must consider:
- What data is.
- Where it comes from.
- How is it going to be used.