Disabling outbound connectivity on web servers [closed]

WordPress uses an HTTP class to make outbound requests. These requests are mainly for plugin, themes and core updates; pull news/rss content; and make third party API requests. There may be many different reasons for disabling outbound requests, security is the primary one. A WP instance with disabled outbound requests is more secure. Many institutions … Read more

Icon font not working on subdomains of multisite

The problem: Console log: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxx. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). The solution: Add the following header to your .htaccess file: # https://wordpress.org/support/topic/font-awesome-not-working?replies=8#post-4921179 # Allow icon font to load on subdomains of WordPress multisite install. <FilesMatch “.(ttf|otf|woff)$”> Header set Access-Control-Allow-Origin “*” </FilesMatch> …before: … Read more

delete_user_meta : how to delete all the metadata of a given user (witout SQL)

Yes, it does delete the usermeta. Here’s the code it uses: $meta = $wpdb->get_col( $wpdb->prepare( “SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d”, $id ) ); foreach ( $meta as $mid ) delete_metadata_by_mid( ‘user’, $mid ); There’s identical code in wp_delete_user (for the non-multisite case) and they use the same pattern for deleting taxonomy metadata, … Read more

Multisite, multiple domains per site

In vanilla WP, a site cannot serve multiple domains like that unless it’s the root site. Additionally, your desired setup would lead you to one of two situations: You’re succesfully serving the site on 2 domains, but all the canonical tags point to the first domain regardless of which is setup Google sees duplicated content … Read more

WordPress Images Not Showing When FTP

Uploading the image is only one part of the process. When you add media to your site via the Media Library, it’s actually added as an attachment, a built-in post type that carries with it a bunch of metadata. Simply FTPing images into the appropriate directory doesn’t create the associated attachment post or set any … Read more

Retrieve taxonomies from arbitrary site

how can I retrieve all taxonomy terms for a post in an arbitrary site programmatically? In other words, given post $post and site $siteId, how can I retrieve all terms for all taxonomies of that post in that site? You can do this by omitting the taxonomy from WP_Term_Query: $query = new WP_Term_Query( [ ‘object_ids’ … Read more