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

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

Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?

You could filter the option requests for the host. In your wp-config.php below the line … require_once ABSPATH . ‘wp-settings.php’; … add the following lines: add_filter( ‘pre_option_home’, ‘set_current_host’ ); add_filter( ‘pre_option_siteurl’, ‘set_current_host’ ); function set_current_host() { return ‘http://’ . $_SERVER[‘HTTP_HOST’]; } add_filter() is not available earlier, and you should keep such code in your wp-config.php. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)