Images will not attach to posts after site migration

  1. check your media upload path in the admin.
  2. verify that your DB has NO references to the old domain
    (I am sure you have done so already, but I will post it anyhow)
    when you do that , include the last trailing slash.

// update WordPress options , SQL command:

  UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name="home" OR option_name="siteurl";

// fix URLs of the WordPress posts and pages, SQL query:

UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

// SQL commands to fix all internal links

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');
  1. if that is not helping, disable all plugins (and custom function – functions.php) , remove all custom JS files, and try again .