In this tutorial, we’ll explore three different methods to remove URL field from comment form in Kadence Theme.
The Kadence Theme is a popular and highly customizable WordPress theme. While the comment form includes a field for visitors to enter their website URL, some users may prefer to remove this field.
- Using a Plugin
- Adding CSS via the Customizer
- Using Code Snippets in functions.php
Methods to Remove URL Field from Comment Form in Kadence Theme
We are going to try 3 methods to remove the URL field in Kadence WordPress Theme.
1. Using a Plugin
The quickest way to remove the website field from the WordPress comment form is to use a plugin.
There are various plugins available that can achieve this functionality. For this tutorial, we’ll use a simple plugin created specifically for this purpose.
- Download the “Remove URL Field in Kadence Theme Comment Section” plugin from the GitHub repository.
- Go to Plugins > Add New > Upload Plugin in your WordPress admin area.
- Browse and upload the downloaded ZIP file, then activate the plugin.
- Once activated, the website field will be removed from the comment form on your Kadence Theme.
Note: This is not an official plugin from Kadence Development Team. WPLogout Team creates this plugin to make the whole process easier for you.
2. Adding CSS via the Customizer
Another straightforward method is to use CSS to hide the URL field from the comment form. You can add the necessary CSS code directly in the Customizer section of the Kadence Theme.
- Navigate to Appearance > Customize > Additional CSS.
- Copy and paste the following CSS code into the Additional CSS section:
p.comment-form-url {
display: none !important;
}
- Click the “Publish” button to save the changes.
This CSS code will hide the URL field from the comment form by setting its display
property to none
.
3. Using Code Snippets in functions.php
If you prefer not to use a plugin or add custom CSS, you can remove the URL field from the comment form using a code snippet in the functions.php
file. To achieve this, we’ll utilize the “Code Snippets” plugin, which allows you to add PHP code snippets without modifying the theme files directly.
- Install and activate the “Code Snippets” plugin from the WordPress repository.
- Go to Snippets > Add New in your WordPress admin area.
- Add a title for your snippet, such as “Remove URL Field From Comment Form in Kadence Theme.“
- Copy and Paste the following code into the code editor:
add_filter( 'comment_form_default_fields', 'kadence_remove_comment_website_field', 20 );
function kadence_remove_comment_website_field( $fields ) {
unset( $fields['url'] );
return $fields;
}
- Click the “Activate” button to save the changes.
This code snippet uses the kadence_comment_form_default_fields_markup
filter to remove the URL field from the comment form markup.
4. Result
After following any of the above methods, you should no longer see the URL field in the comment form on your Kadence Theme website. Visitors will only be required to enter their name, email address, and comment.
Related Kadence Tutorials:
- How to Display Related Posts in Kadence Theme?
- How to Add Social Sharing Buttons in Kadence Theme without Plugin?
- How to Make Sidebar Sticky in Kadence Theme?
- How to Add JavaScript in Kadence Theme?
Wrapping Up
Removing the URL field from the comment form can help streamline the commenting process for your visitors and potentially reduce spam submissions.
The Kadence Theme provides multiple ways to achieve this, including using a plugin, adding CSS via the Customizer, or utilizing code snippets. Choose the method that best suits your preferences and technical expertise.
If you have any further questions or need assistance, feel free to consult the Kadence Theme documentation or reach out to their support team.