Are you using the contact form 7 WordPress plugin in your WordPress website and want to save the form submission data into MySQL database? If your answer is yes, then keep your close attention in this tutorial as I am going to share the steps which let you know how to save contact Form 7 fields data in the database.
Use the below code to save the contact form 7 submission data into your database table. You can use create a separate plugin and add this code in that file OR you can add the below code in your functions.php file from your current activated theme.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
add_action('wpcf7_before_send_mail', 'my_conversion'); function my_conversion($cf7) { global $wpdb; $name = $cf7->posted_data["your-name"]; $email = $cf7->posted_data["your-email"]; $Work = $cf7->posted_data["tel-Work"]; $homenumber = $cf7->posted_data["homenumber"]; $mobilenumber = $cf7->posted_data["mobilenumber"]; //insert into database $wpdb->insert("your_table_name", array( "name" => $name, "email" => $email, "Work" => $Work, "homenumber" => $homenumber, "mobilenumber" => $mobilenumber )); } |
If you don’t want to create a WordPress plugin and also don’t want to add above code in your functions.php file and you want to display the all messages inside in the WordPress admin panel, then keep your close attention in this post as I am going to share a WordPress plugin which will allow you to save all your website’s contact form messages in your site database and also will display in your WordPress admin panel.
Download the latest version of Flamingo WordPress plugin from WordPress plugin directory and install in your website. If you have just started with WordPress, then check out.
Once you have installed and activated this plugin, then visit your website and submit the contact form. Now go back to your WordPress dashboard, you will see some activity inside the Flamingo section. You will see the form data which you have just submitted from front-end site.
Now click on the above listing to see the complete view of that messages. You can also manage all messages by using this page like you can edit and delete.
There are several more WordPress plugins, which will let to save contact form 7 form data in the database. Below is the list of some WordPress plugins:
If you are still facing any issue to save your contact form 7 from messages in your database, then feel free to put your comments in below comment section. Do you like & share this article with your friends, and don’t forget to follow us on Facebook and Twitter to learn cool WordPress tutorials.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: contact form 7, contact form 7 add on, how to create wordpress plugin, wordpress tutorial, wordpress tutorial for beginner, wordpress tutorial for beginners, wordpress tutorials, wordpress tutorials for beginners, wordpress tutorils