Wrong canonical link on wp-admin pages

wp-admin-canonical is broken, as it assumes how WordPress is installed. there was a plugin to fix it, but the plugin was removed from the plugin repository apparently. It is still on github and pluginmirror though: https://github.com/wp-plugins/remove-wp-canonical-url-admin-hack http://www.pluginmirror.com/plugins/remove-wp-canonical-url-admin-hack/

how to use a different domain/subdomain for authors/catagories on single site?

wp-config.php if ( is_alt_domain( $_SERVER[‘SERVER_NAME’] ) ) { $domain = str_replace( ‘www.’, ”, $_SERVER[‘SERVER_NAME’] ); define( ‘WP_SITEURL’, ‘http://www.’ . $domain ); define( ‘WP_HOME’, ‘http://www.’ . $domain ); } else if (is_sub_domain( $_SERVER[‘HTTP_HOST’] ) ) { $domain = “{$_SERVER[‘HTTP_HOST’]}”; define( ‘WP_SITEURL’, ‘http://’ . $domain ); define( ‘WP_HOME’, ‘http://’ . $domain ); } else if (! (is_main_domain( … Read more

Ban SiteNames Multisite

You can filter domain_exists, a check that runs before a site is registered. If you return a positive integer, WordPress will not create that site. Despite its name, that filter lets you check the path too. Sample code, not tested: add_filter( ‘domain_exists’, function( $result, $domain, $path ) { // Already taken, no need for further … Read more

Difference between bloginfo(‘home’) and home_url() and site_url()

The difference in your case is in filters being applied to output of these functions. While bloginfo applies one of these filters: if ( ‘display’ == $filter ) { if ( $url ) $output = apply_filters(‘bloginfo_url’, $output, $show); else $output = apply_filters(‘bloginfo’, $output, $show); } Function home_url applies this filter: return apply_filters( ‘home_url’, $url, $path, … Read more

How to move existing WordPress wp-content folder along with database to new server and new domain name?

There’s a pretty good step by step on moving WordPress in the Codex. It is what I follow when changing domains. Moving the files is pretty straight-forward. It is the hard-coded references in the database that are tricky. However, serialized search and replace will take care of all database changes. I’ve used the Velvet Blues … Read more

Rewrite default post type

Use the field in the admin Settings > Permalinks page to set your permalink structure to /blog/%year%/%monthnum%/%postname%/. To prevent custom post types from inheriting the post permalink structure, set with_front to false in your register_post_type arguments for all custom post types. Version 4.4 also added the register_post_type_args filter to allow modification of post type arguments … Read more

Relative or dynamic site url possible?

I usually just avoid the issue entirely every time I create a new wordpress site: define(‘WP_HOME’, “https://wordpress.stackexchange.com/”); define(‘WP_SITEURL’, “https://wordpress.stackexchange.com/”); will cause wordpress to use root-relative urls for everything. Makes site migrations to other domains far easier. Ofc, if you access your site using a folder (eg. “http://<domain>/blog“) you could change them to: define(‘WP_HOME’, ‘/blog/’); define(‘WP_SITEURL’, … Read more

How do I change the Multisite URL?

There are 5 values need to change. From database. wp_options: options named “siteurl” and “home” wp_site wp_sitemeta: the option named “siteurl” wp_blogs: any entries in the “domains” column that have the old domain name wp_#_options: Each sub-site will have sets of tables that correspond to the blog_id in the wp_blogs table. You need to go … Read more

Getting the Site URL Including the Front Base

You can get the value of front in the global $wp_rewrite: global $wp_rewrite; echo $wp_rewrite->front; // or echo home_url( $wp_rewrite->front ); Though that is probably of limited use, as the front base isn’t necessarily an existing page, and may 404 in many cases. If you’re using that value to prepend to other URLs, you’re likely … Read more

Switch from https back to http

You can try these: 1. make sure the values changed in database If you can’t login to wp-admin > settings to confirm that, you can go to database, wp_options table and look for siteurl and home values 2. add code to wp-config.php Add these lines to wp-config.php define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); 3. Clear your cache Make sure … Read more