wp_update_post ignores if/else

How is this possible? I can think of one possibility that for some reason ur page is getting auto reloaded. So the flow of execution is like: you access the page, your code gets executed changing status from draft to published, then some other code gets executed and the page is reloaded. This time when … Read more

Cannot update page – with too many characters?

I think it’s not the wp-config.php or .htaccess file you need to edit. The problem is web server related. search for php.ini file in your web server directory and there are some specific limits you may need to configure. like following keywords: upload_max_size’ , ’64M’ post_max_size’, ’64M’ max_execution_time’, ‘300’ I hope it helps and feel … Read more

How to update the children of a post?

get_children returns an array of post objects by default: https://developer.wordpress.org/reference/functions/get_children/ So you would have to use ‘ID’ => $child->ID, in this case… also my want to wrap the foreach with if (count($children) > 0) {} to prevent possible errors where there are no children. ie: $children = get_children( $mainid ); if (count($children) > 0) { … Read more

Update around 200,000 posts

You mentioned setting the memory limits and execution time to unlimited, so this may not be the right answer. I thought I’d mention it anyway since it may help. Since you have so much content, you’ll have to find ways to accomplish this in the background rather than during the request. This is the perfect … Read more