0%
Posted inUncategorized

How To Sanitize WordPress URLs

When working with WordPress URLs it is best practice to always ensure they are properly formed and don’t contain any invalid or dangerous characters. The default WordPress esc_url() function lets you easily do just that.

$your_url = 'http://yourpage.com/?awesome=true';
   $url = esc_url( $your_url );

Leave a Reply