How do I restore attachment from files in wp-upload

Yes, you can do this. First set up a loop that loops through all the images in the upload directory. Then construct an array with the required data needed to create a new post of the type attachment: $dir = new DirectoryIterator(wp_upload_dir()[0]); foreach ($dir as $maybeFile) { if ($maybeFile->isFile()) { $filename = $maybeFile->getPathname(); $wp_filetype = … Read more

Set a minimal number for next user_id

You can access via phpMyAdmin and change the Auto Increment number to be your next user ID number. Open phpMyAdmin Go to SQL tab at the top. Enter the following: ALTER TABLE ‘wp_users’ AUTO_INCREMENT=32200906; Now create a new user and the ID should be 32200906

How to create import option for xml

Sound like an interesting, but I think it would be very difficult, because content is more than just posts: Post authors for the demo content must match existing users. Taxonomies (tags, categories, nav menus) are bound to existing content. Comments need proper associations with post IDs and post types. One way to do what you … Read more

Imported Posts missing summary text on staging site

Although there’s little chance that something went wrong, first of all make sure that you content is actually there. Just edit a post from your dashboard and make sure it looks like it should, Now, it looks like you have different themes on you live and staging sites, so it most probably is an issue … Read more