WordPress CSV Importer takes a long time to finish

I have created a lot of custom CSV importers for WordPress in the past and I have come across issues related to the time it takes for them to finish processing. Whenever the importer starts running, it starts off importing a lot of posts per second but this speed keeps decreasing and I am trying to figure out the reason for this and if whether there is something that I can do to speed up things. Some importers I create …
Category: Web

Product CSV import problems with certain html tags

I'm transferring all of my WooCommerce products from one installation to another just by simply exporting the products to CSV and importing them again. Initially, the import would not work and the error message: Sorry, you are not allowed to upload this file type. This was a bit of a surprise as it was just an export csv file from another WooCommerce site. So I downloaded a sample csv import file and this worked fine. To cut a long story …
Category: Web

import (migration) user database to wp-users

I am having hard time for importing to user-meta and post-meta from my non-wp-tables. I am trying to do db migration from user table and post table to WordPress tables. So it might be user table to wp-users and wp-usermeta post table to wp-posts and wp-postmeta I have been trying to find good plugins but it's all limited. (only basic information) My old user table has all of users information on only 1 row (1 line) such as phone number, …
Category: Web

WordPress All-Import to ATUM Stock Management

When importing and creating/updating products in WooCommerce the fields used in and by ATUM Stock Management doesn't get updated. On the stockmanagementlabs forum one user posted a suggestion to be added to functions.php: add_action('pmxi_saved_post', 'post_saved', 10, 1); function post_saved($id) { // get custom field $purchase_price = get_post_meta($id, '_atum_purchase_price', true); // Insert the field into the database if(isset($purchase_price)){ $wpdb->update( "{$wpdb->prefix}atum_product_data", array( 'column1' => 'purchase_price', 'column2' => $purchase_price ), array( 'product_id' => $id ), array( '%s', '%d' ), array( '%d' ) ); …
Category: Web

How to bulk add vast amounts of posts

I'm looking for a way to automatically add a large number of example posts to a WordPress blog for testing purposes. I have the requirement to test a bulk process on 15,000 English blog posts (one or two paragraphs of text and nonsensical titles will do). As you can imagine, getting this volume of test content populated isn't something one would like to do by hand!
Category: Web

List page is showing 404

I have built a new site based on a content from an old one. Also, there is some partial content in another WordPress blog which I have to import. Unfortunately, on the blog I don't have full access, but the owner shared the full backup file. I needed only some categories, not the entire blog. So, I tried to import the file in a brand-new website, on a subdomain, but the export file was too big and the settings of …
Category: Web

Import Instagram post as Wordpress post

I've been searching a lot but haven't found one very simple thing: how to import a post created on Instagram and turn it into a Wordpress post, that is, copy one Instagram post (text + photo) and create a simple post on the Wordpress blog?
Category: Web

Importing CSV into database table not working?

global $wpdb; if (isset($_POST["import"])) { $fileName = $_FILES["file"]["tmp_name"]; if ($_FILES["file"]["size"] > 0) { $file = fopen($fileName, "r"); while (($column = fgetcsv($file, 10000, ",")) !== FALSE) { $table_name = 'sas' ; $wpdb->insert( $table_name, array( 'category' => '" . $column[0] . "', 'temple' => '" . $column[0] . "' ) ); } } } I want to import csv directly into the core wordpress database table 'sas' .The csv contains some records with the structure of the table i have created...But the …
Category: Web

How do you do your big exports / imports?

I have a big client (50k orders, 70k customers), I'm working today on the migration of his site on a new version of WordPress on a new server. I need to export and import the products / customers / orders on the new WordPress without any ID modification. Problem, after working on the site I realize that the import is impossible because various customer and order IDs are already taken. How do you do exports / imports like this? Do …
Category: Web

How to add CSV upload functionality on the edit page of a Custom Post Type

So, I am creating a school website based on WordPress. In that, I need to show birthdays of students on the front page. I've created a Custom Post Type named Birthdays which will contain the list of all the students and their birthdays. I need to upload the details of students like, student name, date of birth, class, etc. in bulk using a CSV file. How do I accomplish this. I've tried used this code to show an upload button …
Category: Web

Bulk-create posts from SQL database

I'm new in this forum and fairly new to Wordpress as a whole, so I hope I will abide by all written and unwritten rules when posting this. I have an SQL database with around 4,000 posts from an old website. Each post has an ID, date, title, body, keywords, and category column (and some others that are irrelevant). These columns are, as far as I've seen it, not named in a default manner but are, at least in part, …
Category: Web

how to convert a wp multisite into a single site with content from subsites

trying to convert an old wp multisite (v3.8) into a single site with data from active sites, since multisite setup is huge (containing about 50k subsites of which we only need about 2.5k) I can't just dump and import the data and then delete the data we don't need. I've tried exporting the relevant data with wp-cli and then importing it to the new site, which resulted in 2 major problems: partial data for some users (a user may have …
Category: Web

Realtime database update from 3rd party apps (notion, airtable, sheet, etc)

Can I achieve Realtime database update from spreadsheet? My requirements: I have many posts with custom fields that have certain values. I have all these values stored on a spreadsheet (GoogleSheets, Airtable, Notion - you name it!). lets say a value is changed on the spreadsheet and this value was used in 20 different posts. Is there a way that I can automate this task and update it in realtime somehow without having to manually edit every post? is this …
Category: Web

Importing a Google Group to bbPress

I'm trying to migrate a google group to a bbPress forum on a wordpress site. I ran into this plugin https://wordpress.org/plugins/import-export-for-bbpress/ but it doesn't have a UI. This might be a dumb question from a complete newbie but how do I run a plugin without a UI? Update I put the wrong plugin link for the import. I meant this plugin: https://wordpress.org/plugins/bbp-import-google-group/ Is there a better way to import the content of a google group to a new forum in …
Category: Web

Showcase elementor templates

I am being confused about how to structure my WordPress website, I want to make a website where I can show WordPress templates (elementor templates to be specific). I don't want to sell them, I am selling my services but that's irrelevant. I just want to structure a website where customer can click on the category (industry type) and choose a template he/she wants. Maybe I can get notified but I have alternatives to that as well. How do I …
Category: Web

Imported Content Doesnt Show Up On Frontend

I found similar problems posted couple times, for different custom post types, but none of the solutions worked for me and these, other questions, didnt have much info provided, I'll try to give as detailed info as its possible and hopefully, this thread will help many others in my situation. Problem: I exported custom post type content from WordPress, and imported it into another WordPress. Content is there in the Database and in Backend, however, nothing shows up on the …
Category: Web

Insert post without actions/hooks

I am developing a custom importer for WordPress (because we have a very custom setup and the available tools don't seem to work for our scenario). During this import, I'd like to disable any hooks there are when creating/updating a post. For instance this hook is being fired, and it is generating some errors: add_action( 'woocommerce_process_product_meta_simple', array( $this, 'on_simple_product_publish' ), 10, // Action priority 1 // Args passed to on_product_publish (should be 'id') ); add_action( 'woocommerce_process_product_meta_variable', array( $this, 'on_variable_product_publish' ), …
Category: Web

I am trying to match the wpallimport using the Xpath Filter

While Matching the Xpath Filter to set not to import properties having the city Gandia , this works but some properties are having Gandía , Jávea. So it is not matching. Issue seems to be with this í , á characters. /property[price[1] > 5000 and town[1] != "Jávea" and town[1] != "Calpe" and town[1] != "Elche" and town[1] != "Gandía" and town[1] != "Oliva" and town[1] != "Valencia" and town[1] != "Valle de Albaida"]
Category: Web

INSERT ON DUPLICATE KEY UPDATE failes in postmeta table

INSERT ON DUPLICATE KEY UPDATE Mysql query is not working with Postmeta table. It adds new/duplicate rows to the table. I couldn't find a way to solve this. I need to use this as part of a bulk import script. My query is: INSERT INTO \`wp_postmeta\` (\`post_id\`, \`meta_key\`, \`meta_value\` ) VALUES (21100,"bygg_address","BILGATAN1 9 222B") ON DUPLICATE KEY UPDATE `meta_value` = "BILGATAN1 92 B"; Even though I have a row with 21100, "bygg_address", "BILGATAN1 9 222B", it inserts a duplicate row …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.