How to transfer a WordPress blog to a different domain?

I recommend handling the 301 redirect in your web server rather than in WordPress. mod_rewrite or RedirectMatch will be much more efficient than spinning up WordPress to deliver a Location: header. <VirtualHost *:80> ServerName busted-cheap-url.com # mod_alias RedirectMatch permanent (.*) http://great-new-url.com$1 # OR mod_rewrite RewriteEngine on RewriteRule (.*) http://great-new-url.com$1 [R=301] </VirtualHost> There are several methods … Read more

Change site url when moving site to another url?

Those parameters and admin settings change the URLs in the database. The only other way to do that is run SQL queries on the DB in phpmyadmin to change them: UPDATE wp_options SET option_value = replace(option_value, ‘http://olddomain.com’, ‘http://newdomain.com’) WHERE option_name=”home” OR option_name=”siteurl”; UPDATE wp_posts SET guid = replace(guid, ‘http://olddomain.com’,’http://newdomain.com’); UPDATE wp_posts SET post_content = replace(post_content, … Read more

Migrating Markdown (from Drupal)

Note: The following is largely untested (It worked after testing on one post). As you’ve pointed out when you edit a post, the plug-in takes the content in the database (HTML) and converts that to MarkDown for editing. Since in your case the content is actually not in HTML, but already in MarkDown, we want … Read more

Why does WordPress use serialize rather than json_encode for the options table? [duplicate]

serialize representation can be stored in text and reversed JSON representation can be stored in text but cannot always be precisely reversed Run this example: $query = new WP_Query(); var_dump( $query ); var_dump( unserialize( serialize( $query ) ) ); var_dump( json_decode( json_encode( $query ) ) ); After going through serialize accurate WP_Query object is re-created. … Read more

How can 2 blogs share the same users

I think you want to install your second site on the same database but with a different table prefix, e.g. $table_prefix = “qa_”; in wp-config.php You are then able to define a custom user and/or user_meta table by adding the following lines to wp-config.php define(‘CUSTOM_USER_TABLE’, [orig_table_prefix].’my_users’); define(‘CUSTOM_USER_META_TABLE’, [orig_table_prefix].’my_usermeta’); Source: http://codex.wordpress.org/Editing_wp-config.php#Custom_User_and_Usermeta_Tables I have read somewhere before … Read more

How do you seamlessly switch hosting?

Put old host in read-only mode Go to WP Admin -> Settings -> Discussion and check “Users must be registered and logged in to comment” Disable authentication: Create a PHP file inside the wp-content/mu-plugins folder, with the following content: <?php function wp_get_current_user() { return new WP_User(-1); } This will prevent all logged-in users from leaving … Read more

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