There is some way to import excel to WordPress database. but I have an easy solution to import this file.
- Go to convertcsv.com and convert your excel file to JSON.
- Create the below files and folders:
Folder: wp-content/plugins/import/
File: wp-content/plugins/import/import.json
File: wp-content/plugins/import/import.php
Then save JSON file to import.json
Put below code in import.php
' . print_r( $data, 1 ) . ''; // Each data foreach ( $data as $item ) { // Create post object $args = array( 'post_title' => $item['title'], // your column 'post_content' => $item['content'], // your column 'post_status' => 'publish', 'post_type' => 'post', 'post_author' => 1 ); // Insert the post into the database //$post_id = wp_insert_post( $args ); } } exit; }Go to Plugins and enable Import plugin. then run this request in your WordPress:
Don't forgot, You should get valid data from your json. You can see this data through print_r
befor each data.