Skip to content
Advertisement

Bulk move 130,000 post content value to a custom Filed in wordpress

My current blog already has 130,000 pieces of data, and the content of each of my articles is a number.The content body of all articles is a number。

I want to batch transfer the content field value to a new field named ‘views’.

I used the method of this tutorial

Never succeed with below message Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /usr/local/lighthouse/softwares/wordpress-plugin/wp-includes/class-wp-term.php on line 198

After that I modified the memory size in the php.ini and wp-config.php files, but still not working.

blow is the code I used in function.php

JavaScript

Advertisement

Answer

You must do that by MySQL query like this in wp function:

JavaScript

Also, You can run this directly on wp_postmeta table in database:

JavaScript

*Trick: If wp function doesn’t work by load website, comment this line:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement