Hot answers tagged

34

The Media Library lives in both wp_posts and wp_postmeta. wp_postmeta contains the image URL wp_posts contains an entry for each image insertion into a post, along with the post ID. Exporting and importing these 2 tables as SQL did not work for me - I received 'duplicate entry for key 7'... Exporting and importing these 2 tables as CSV did work, using "...


29

Select * from wp_posts where post_type = 'attachment'; Will return all the entries in the Media Library. After the execution, you can export the result table as SQL, or CSV, or any other portable data format you like. Remember, if you are not sure if the entries already exist in your database, use the INSERT IGNORE statement instead of INSERT. (This is ...


20

Why images don't get imported It's the export step that causes the issue here with image attachments. WordPress’ export function doesn’t include the “attachment” post type unless you select the “All content” export option. But if you only want to import and export your posts from one site to another, you lose your attachments. There is more information ...


19

Your question is a bit specific if you "only" want to automatically import some posts/pages. There are other ways to do this then using a XML export file. If you have text-only posts, then you should use LOAD DATA INFILE. At first you have to export your posts. global $wpdb, $wp_filesystem; $tables = array( 'posts' => array( 'posts', '...


17

When I use WordPress Import in this cases, this is what I do: Export the XML in localhost. Open the exported file in a text editor. Search and replace http://localhost/wp-content/uploads/ for http://example.com/custom-temporary-folder/. Upload the uploads folder via FTP to the custom-temporary-folder. Perform the Import in example.com using the modified ...


16

Use Export Featured Images plugin that let you export Featured images from posts or custom post types into a WordPress xml so you can import them in other sites using the WordPress importer tool. https://wordpress.org/plugins/export-featured-images/#description How to use?? First, import your posts to the new site. Use this plugin in your old site and ...


12

It is that simple for Wordpress too. I use the following to back up my WP sites: mysqldump -u <user> -p<pass> --quick --extended-insert <db-name> > backup.sql The mysqldump document gives the details on all the parameters. --extended-insert is quicker when updating a DB from a dump file and makes the dump file smaller. --quick makes ...


12

I had a very similar problem when I moved a WordPress Blog from a single WordPress installation to a Multisite installation with different domain names but same IP. I found out that the problem is the wp_http_validate_url function which drops the URL if the source IP is the same as the destination IP. You can add a filter wp_http_validate_url to prevent this ...


11

To deal with this issue I always use WordPress Serialized Search & Replace tool provided here. It works perfectly fine with out any issues. I have been using this for a long time on all my site migration requirements. This really take care of the issues with migrating development database to production. https://interconnectit.com/products/search-and-...


10

OPTION 1: If a WordPress WXR file, an XML file exported from WordPress, is too large to import, there are several things you might try to overcome that limit. Increase the amount of memory a PHP script may consume. Note: If using a shared hosting service, you may need to ask your host to increase the limit. Increase the memory limit setting in php.ini (e.g....


10

if you check the Wordpress importer plugin it is easy to implement this feature. But if you want the direct answer , here it is First of all, we need to copy the Wordpress importer plugin files to our theme directory. like this 1. themes/bootstrapguru_theme/inc/wordpress-importer.php 2. themes/bootstrapguru_theme/inc/parser.php you can find ...


6

This answer is essentially the same as Ünsal's, but I'd like to elaborate a bit because despite being right his answer didn't help me (I was just trying to remember what I'd done in the past, I should have read his more carefully and I would have figured it out, but I think for others a full description would be useful). To export the full category ...


6

if you have access to the .htaccess file in your www folder. Just include the following 2 lines in .htaccess: php_value upload_max_filesize 50M php_value post_max_size 50M Other way .. you can place this piece of code in your theme's functions.php file @ini_set( 'upload_max_size' , '50M' ); @ini_set( 'post_max_size', '50M');


6

how is "already present" defined here anyway (post_id? term_id? name)? The post title and date must match to be already present. The WordPress post_exists() function is used to determine if the post exists. From the plugin code: $post_exists = post_exists( $post['post_title'], '', $post['post_date'] ); The is no filter provided to change this behavior. ...


6

I used a plugin called Really Simple CSV Importer https://wordpress.org/plugins/really-simple-csv-importer/ If that link is dead, you can find it on github here: https://github.com/dansullyLT/rs-csv-importer It populated my custom fields that I made in ACF. Here is how I used it. Download the sample CSV file the plugin dev offers you. You make each ...


6

This issue is as a result of your server not supporting the utf8mb4_unicode_520_ci collation type. To resolve this you should convert the collation for all tables with utf8mb4_unicode_520_ci to utf8_general_ci If you're exporting through phpmyadmin, you can: Click the "Export" tab for the database Click the "Custom" radio button Go the section titled "...


5

Although Chip's method may work for some it did not for me. I did get it working however this way: Do the normal export of pages and posts and import them to your new blog (having deleted the original pages and posts) Download the wp-content/uploads folder via ftp from your old site and upload it to your new site, replacing what's there. Go into phpmyadmin ...


5

Thanks @kaiser but not need to go through your solution I found a easy one and I'll share here for newbie likes me. If you're working on a WP Network site then the steps are: At the top, hover over My Sites and then click Network Admin. At the left, hover over Settings and then click Network Settings. Scroll to the bottom of the page and change the Max ...


5

WordPress has a perfect wrapper for HTML > Theme conversion: The theme itself. All information can be found in the Codex page. It is enough to add a folder to your wp-content/themes directory (or whatever directory you registered in addition to that), and add the following files functions.php style.css index.php header.php to your custom themename folder. ...


5

There are 2 ways that you could do this. The first and more difficult is to write a program, the other is to do a bulk update. Why do difficult when easy way will work equally well? and especially as this is a once-off requirement The easy way: In the admin dashboard, select the view with all posts for your custom type Select all the posts (tick them) - ...


4

Very simple plugin to achieve this. Runs only on activation, so, if there are 5 CSV files, the plugin must be activated/deactivated five times. File: /wp-content/plugins/create-cats-from-csv/create-cats-from-csv.php <?php /* Plugin Name: Insert CSV Categories Version: 1.0 Description: Reads a CSV file on plugin activation and insert the ...


4

Allow me to re-introduce 2 things here: (a) "I am not asking how to... I've got that part sorted..." »» I've learnt over time to be OK with the fact that the approach to issues/fixes doesn't necessarily require some 'visible association' with the issue at hand. (b) "...would I have to do to strip out the parts..." "...clients are tradesmen, so even ...


4

http://www.wpallimport.com/ There's a free version of this plugin that should do all the necessary work to import Custom Post Types from a CSV or Excel file. The paid versions also allow you to import users and to better modify advanced custom fields associated with CPT's as well.


4

@import is a convenient CSS shortcut for loading a particular stylesheet (often parent themes or other dependencies), but part of the reason why it's generally discouraged is due to - as you had mentioned - a small performance hit (stylesheets loaded with @import are not loaded in parallel). Another reason is that by loading stylesheets with Wordpress' ...


4

The post that an attachment is related to is determined by the post_parent column on the wp_posts table (depending on your database prefix). Set it to the post_ID of the parent post.


4

That error suggests that the WXR_Parser class is already "running" or declared. It's possible that a theme or another plugin has incorporated that class and did not check if it existed already before initializing. ie. if ( ! class_exists( 'WXR_Parser' ) ). To locate the source of the conflict, deactivate each theme and plugin one-by-one. You should be left ...


4

The issue is you're trying to import posts with a post type of feedback, but there is no such post type registered on your install of WordPress. Quick-and-easy fix is to register one: add_action( 'init', function () { register_post_type( 'feedback', [ 'public' => true, 'labels' => [ 'singular_name' => 'Feedback', ...


3

Hook int force_filtered_html_on_import and return FALSE. See ticket #14818. add_filter( 'force_filtered_html_on_import' , '__return_false' ); By default this is set to TRUE in wp-includes/ms-default-filters.php.


3

This is really more of a server admin question than Wordpress. Error logs and php.ini file locations can vary depending on the server OS. You need to change the upload and timeout limits for php. Do that either in the main php.ini file or enable php.ini in your web directory and try: max_execution_time = 120 max_input_time = 120 memory_limit = 128M ...


3

Here is an import file where only a few settings are used (although you may be able to exclude even more), which successfully imports three posts (tested on WP 4.2.2): <?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0" xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" ...


Only top voted, non community-wiki answers of a minimum length are eligible