Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

urlencode shortcode

// Add Shortcode
function meh_urlencode_shortcode( $atts , $content = null ) {

	return urlencode( do_shortcode($content) );

}
add_shortcode( 'url_encode', 'meh_urlencode_shortcode' );