Remove http or https from URLs $url = preg_replace( '(^https?://)', '', $url ); Source: https://stackoverflow.com/a/14369037/778809