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' ),
    10,  // Action priority
    1    // Args passed to on_product_publish (should be 'id')
);

add_action(
    'woocommerce_process_product_meta_booking',
    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_external',
    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_subscription',
    array( $this, 'on_product_publish' ),
    10,  // Action priority
    1    // Args passed to on_product_publish (should be 'id')
);

add_action(
    'woocommerce_process_product_meta_variable-subscription',
    array( $this, 'on_product_publish' ),
    10,  // Action priority
    1    // Args passed to on_product_publish (should be 'id')
);

Is there a way to disable all actions? Or should we run a custom MySQL query to insert into the database instead?

Topic mysql actions php import bulk-import Wordpress

Category Web

About

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