Remove the http protocol from images

The code you provided could cause issues with 3rd party URLs in hyperlinks not running https. You can fix this by including your home url, e.g: $content = str_replace( set_url_scheme( home_url(), ‘http’ ), set_url_scheme( home_url(), ‘relative’ ), $content); Next, you’re applying this when you’d like to display the content, which means you need to do … Read more

Remove rel=shortlink from HTTP header

<?php add_filter(‘after_setup_theme’, ‘remove_redundant_shortlink’); function remove_redundant_shortlink() { // remove HTML meta tag // <link rel=”shortlink” href=”http://example.com/?p=25″ /> remove_action(‘wp_head’, ‘wp_shortlink_wp_head’, 10); // remove HTTP header // Link: <https://example.com/?p=25>; rel=shortlink remove_action( ‘template_redirect’, ‘wp_shortlink_header’, 11); } Tested in WordPress 4.4 and up to 4.9.1

Is curl required?

For the record, I have uninstalled curl and wordpress was working on seamlessly. So I confirm that curl is not a dependency of wordpress. However, some plugins may require curl.

How do I troubleshoot responses with WP HTTP API?

We tracked it down to content-encoding’ => string ‘deflate’ (length=7) being at fault. WP_HTTP is adding in a deflate header for no reason and un gzip compressing the results. It only happens when the body of the response is under a certain string length. Very annoying when all you want isa 1 or a 0. … Read more

Remove HTTP: from the site URL and just keep // in it

To remove http: and https: from all links, use the following script: add_action( ‘plugins_loaded’, ‘wpse_232287_init’ ); function wpse_232287_init() { // Initiate the function ob_start( ‘wpse_232287_remove_http’ ); } function wpse_232287_remove_http( $buffer ) { // Check for a Content-Type header, only apply rewriting to “text/html” or undefined $headers = headers_list(); $content_type = null; foreach ( $headers as … Read more