Syncing local content with development / staging sites

Overview That’s the one main caveat of WordPress development, that even a seasoned WordPress developer still wonders what’s the perfect automation for syncing database content from local environment to live server. You can’t just upload your database dump from your local development environment to the server and be happy with the results. WordPress actually stores … Read more

Broken CSS after changing the site URL

If you have access to your mysql you can update the wp-options table. Before modification… $ mysql -u <db_user> –password=<db_pwd> -D <db_name> <<<“select * from wp_options where option_name in (‘siteurl’, ‘home’);” +———–+—————–+—————————————————————————————————+———-+ | option_id | option_name | option_value | autoload | +———–+—————–+—————————————————————————————————+———-+ | 1 | siteurl | http://172.17.0.2/wordpress | yes | | 2 | home … Read more

Recover WordPress blog from an inactive domain name

If you have problems to log even into your blog, edit wp-config.php: Add these two lines to your wp-config.php, where “example.com” is the NEW location of your site. define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); This will at least make it useable again (but won’t fix links inside post and page content, see Ticket #4003). . Additionally you can add … Read more

Moving WordPress.com theme and widget settings to self-hosted site?

First off, check if the theme is available in wordpress.org themes: http://wordpress.org/extend/themes/ If it’s not, find the name of the theme developer and contact them. Many developers of wordpress.com themes are happy for people to use their themes on self-hosted WordPress blogs. The developer’s name and contact details can be found by looking at style.css. … Read more

Best way to import users, post and categories from an external database

Unless there is a core WordPress import filter available for your CMS ( see http://codex.wordpress.org/Importing_Content ) or a plugin for a CMS not covered by core WP ( see http://wordpress.org/extend/plugins/search.php?q=import ), or a Google search for your database schema doesn’t reveal anything, you need to roll your own importer. The best way is to write … Read more

Migrating data between local and development server

Assuming your wp-config.php is already in place and in order: Step 1. Mysqldump your development database Step 2. Replace all instances of development.domain.com to production.domain.com^^ Step 3. Login to MySQL, run a SOURCE command to import data e.g. source /path/to/file ^^ How to replace all instances of old domain with new: (1) Copy the script … Read more

Migration issue – blog home page is blank

My experience with blank home page. Sometimes when you are migrating your page you can get blank home page. I found the problem with the home page not displaying from the base URL. it was because there was a default.html file in the root directory. The old hosting server must had set the order to … Read more

URL rewrite based on a custom field value

here is an idea, first add lid to query_vars: add_filter(‘query_vars’, ‘lid_query_vars’); function lid_query_vars($vars) { // add lid to the valid list of variables $new_vars = array(‘lid’); $vars = $new_vars + $vars; return $vars; } then use parse_request hook to create your redirect add_action(‘parse_request’, ‘lid_parse_request’); function lid_parse_request($wp) { // only process requests with “lid” if (array_key_exists(‘lid’, … Read more

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