- Creating and Publishing a Form
- Instant Forms
- Conversational Form
- Create Multi Step Forms In WordPress
- Using Calculations in SureForms: A Step-by-Step Guide
- Calculation Formula Guide
- SureForms Login Block – Step-by-Step Guide
- SureForms Registration Block – Step-by-Step Guide
- SureForms – PDF Generation Feature
- GDPR Compliant Forms
- Unable to Upload SureForms ZIP: File Unzipped On Download
- Browser Support for SureForms
- Not Getting Update Notifications
- How To Rollback to Previous SureForms Versions
- Publishing Failed: Invalid JSON Response
- Troubleshooting Email Sending In SureForms
- SureForm Submissions Marked as Spam – How to Fix
- API Request Failed – Nonce Verification Error
- Fixing the “Destination folder already exists” Error When Installing SureForms
- How to Set Up SureForms with Caching Plugins
- srfm_enable_redirect_activation
- sureforms_plugin_action_links
- srfm_quick_sidebar_allowed_blocks
- srfm_integrated_plugins
- srfm_suretriggers_integration_data_filter
- srfm_form_submit_response
- srfm_enable_gutenberg_post_types
- srfm_languages_directory
- srfm_form_template
- srfm_disable_nps_survey
- srfm_after_submit_confirmation_message
- srfm_email_notification_should_send
- srfm_email_notification
- How to Remove the Asterisk (*) from Form Placeholders in SureForms
How to Remove the Asterisk (*) from Form Placeholders in SureForms
By default, SureForms adds an asterisk (*) to placeholders when a field is required. If you want to remove the asterisk but still keep the field required, you can do this by adding a filter.
This guide will show you how.
What’s the Problem?
When you mark a field as required, SureForms automatically adds an asterisk (*) to the placeholder text. Some users prefer to keep the field required but remove the asterisk for design or styling purposes.
How to remove this
You can remove the asterisk by applying a custom filter in WordPress.
Step 1: Add the Code Snippet
Copy the code below:
add_filter( 'srfm_value_after_label_placeholder', 'update_required_sign_after_placeholder');
function update_required_sign_after_placeholder( $sign ) {
//Must be a string.
// Can be returned as empty string.
$sign = 'test';
return $sign;
}
Step 2: Apply the Code
You can apply this snippet in one of two ways:
- Using the Code Snippets Plugin (Recommended):
- Install and activate the Code Snippets plugin.
- Go to Snippets > Add New.
- Paste the code and save it.
- Activate the snippet.
- Using Your Child Theme’s functions.php File:
- Go to your WordPress dashboard.
- Navigate to Appearance > Theme File Editor.
- Open your child theme’s functions.php file.
- Paste the code at the end and save it.
Troubleshooting
If the asterisk (*) still shows up after adding the code, try these steps:
- Clear your cache: If you’re using a caching plugin or server-side cache (like Cloudflare), clear it to see the changes.
- Check if the snippet is active: If you used the Code Snippets plugin, make sure the snippet is enabled.
- Theme or plugin conflict: Temporarily switch to a default theme (like Twenty Twenty-Five) and check if the filter works. If it does, the issue may be caused by your theme.
- Double-check placement: If you added the code in the child theme’s functions.php, confirm it was pasted at the end and saved properly.
- PHP errors: If your site shows errors, check the syntax carefully or remove the code and add it again.
We don't respond to the article feedback, we use it to improve our support content.