Title: URL Validation requires http://
Last modified: June 20, 2024

---

# URL Validation requires http://

 *  Resolved [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/)
 * URL Validation in Hustle requires “[http://&#8221](http://&#8221); prefix – forminator
   URL validator does not require this.
   I think it’s better to not require http://
   as many people are not even aware of that prefix anymore because most browsers
   hide it by default.Is this something that might change or can we have an option
   to have the same validator being used in Forminator instead?

Viewing 15 replies - 1 through 15 (of 15 total)

 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17840670)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * I hope you are doing well today.
 * Thank you for those details. I will bring this to our Forminator and Hustle Team’s
   attention and see which road to choose and I will mention your suggestion. As
   a temporary solution, you can place a Forminator form in a popup which will help
   you skip that HTTP validation.
 * Kind Regards,
   Kris
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17845840)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * I hope you’re well today!
 * Our developers already have a task for future to update the validation in Forminator
   so it will be “unified” (though I don’t have ETA).
 * For now, you can use this code as a workaround to make validation in Forminator
   the same as it is in Hustle:
 *     ```
       <?php 
       add_filter( 'forminator_field_website_validation_rules', 'wpmudev_validate_website_url', 10, 3 );
       function wpmudev_validate_website_url( $rules, $id, $field ) {
       	if ( false !== strpos( $rules, 'validurl' ) ) {
       		$rules = str_replace( '"url": false,', '', $rules );
       	}
       	return $rules;
       }
       ```
   
 * To add it to site:
 * – create an empty file with a .php extension (e.g. “formiantor-url-prefix-validation.
   php”) in the /wp-content/mu-plugins folder of your site’s WordPress install
 * – copy above code and paste it into that file
 * – save the file.
 * It should then work out of the box.
 * Best regards,
    Adam
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17871059)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/),
 * Since we haven’t heard from you for a while. I’ll mark this thread as resolved
   for now. Please feel free to open a new thread if you have new queries.
 * Kind Regards
   Nithin
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17873896)
 * Hello,
 * Sorry for the late reply!
 * Thank you for the suggestion and the code!
 * However, I think it’s better to not require the “[http://&#8221](http://&#8221);
   prefix. Is it possible to do that?
 * Look forward to hearing from you.
 * Sebastian
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17875041)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * Thank you for response but I’m a bit confused now.
 * You already can simply disable validation in field settings. If you set validation
   to “none” it will not check for protocol prefix.
 * Or do you mean to have some sort of validation there but in a way that will only
   skip prefix (like: if it’s there, it’s fine, if it’s not there it’s fine too,
   provided that the rest of the string appears to be an URL)?
 * Kind regards,
    Adam
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17876018)
 * Hello,
 * Thanks for your reply.
 * I think you got it in your last paragraph, pasted below.
 * > Or do you mean to have some sort of validation there but in a way that will
   > only skip prefix (like: if it’s there, it’s fine, if it’s not there it’s fine
   > too, provided that the rest of the string appears to be an URL)?
 * Let me break it down again just to make sure we understand each other 🙂
 * Forminator URL validation will allow BOTH: “example.com” and “[http://example.com&#8221](http://example.com&#8221);
 * Hustle URL validation will allow ONLY: “[http://example.com&#8221](http://example.com&#8221);
 * I think the forminator validation is better because most people forget about 
   http://
 * Best,
 * Sebastian
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17877916)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * Thank you for response and confirmation, all seems clear now.
 * We’ll need to consult that with our developers so I’ve already asked them and
   we’ll update you here once we got feedback.
 * I’d appreciate some patience, though. They are dealing with a lot of complex 
   tasks on daily basis so it may take a bit longer to get response. But we’ll update
   you here right away once we get it.
 * Best regards,
    Adam
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17880179)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * I just got response from our developers and they provided another piece of code
   that should do the trick. With the code validation in Hustle should work like
   this:
 *     ```
       example.com           VALID
       http://example.com    VALID
       https://example.com   VALID
       johndoe@example.com   NOT VALID
       ```
   
 * You’ll find the code here:
 * [https://gist.github.com/wpmudev-sls/c96c180266795197c7ee3344b875b712](https://gist.github.com/wpmudev-sls/c96c180266795197c7ee3344b875b712)
 * Please add it to your site as a Must Use plugin (same way as you added previous
   one) and then make sure that in URL field settings in Hustle validation is disabled–
   this is important; it has to be disabled in plugin so this code would take over.
 * It should do the job then.
 * Kind regards,
    Adam
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17886292)
 * Hello,
 * Thank you! Although that is letting anything through. I can just type in “example”
   and it is allowed. Can you please check with the developers if there was a mistake?
 * Best,
 * Sebastian
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17888141)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * I could replicate this issue and will bring attention to our developers, we will
   keep you posted.
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17888155)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * An update here, the script is using filter_var function with the FILTER_VALIDATE_URL,
   it will validate the example as a valid URL hence you can have “localhost” or
   just configure your local computer to point to any string like [http://example](http://example)
 * Best Regards
    Patrick Freitas
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17890734)
 * Hi,
 * Sorry I’m not familiar with the PHP language and I don’t understand the last 
   statement.
 * I thought we were aiming for validation that was intuitive for the user and prevents
   recieving junk data like below:
 *     ```wp-block-code
       example.com           VALIDhttp://example.com    VALIDhttps://example.com   VALIDjohndoe@example.com   NOT VALIDexample               NOT VALIDhttp://example        NOT VALID
       ```
   
 * Please can you break down what you mean with the statement below?
 * > …it will validate the example as a valid URL hence you can have “localhost”
   > or just configure your local computer to point to any string like [http://example](http://example/)
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17892208)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * > Please can you break down what you mean with the statement below?
   > …it will validate the example as a valid URL hence you can have “localhost”
   > or just configure your local computer to point to any string like [http://example](http://example)
 * The script that we shared is using core PHP “tool” to validate URL. PHP takes
   into account that the site may be installed under so called “local domain name”.
   Basically, it’s a non-public domain used e.g. when you develop the site using
   local webserver on your local computer instead of some hosting/server “on the
   internet”.
 * Such domain can be anything, like “[https://example&#8221](https://example&#8221);,“
   [https://localhost&#8221](https://localhost&#8221);, “[http://something.dev&#8221](http://something.dev&#8221);
   and so on -that’s solely up to your local webserver configuration but it’s a 
   perfectly valid domain. That’s why it is validated by PHP out of the box.
 * > I thought we were aiming for validation that was intuitive for the user and
   > prevents recieving junk data like below:
 * Yes, we were but our developers used that PHP function as it’s simply compliant
   with the [RFC 2396 standard](http://www.faqs.org/rfcs/rfc2396.html).
 * But I’ve asked them already to adjust that to follow your example validation 
   exactly. We’ll update you here again soon.
 * Kind regards,
    Adam
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17894902)
 * Hi [@sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * Our developers updated the code so now it validates as listed below.
 * YES:
 * example.com
    [http://example.com](http://example.com) [https://example.com](https://example.com)
   [http://www.example.com](http://www.example.com) [http://www.example.com](http://www.example.com)
   [https://www.example.com](https://www.example.com)
 * NO:
 * [johndoe@example.com](https://wordpress.org/support/topic/url-validation-requires-http/johndoe@example.com?output_format=md)
   
   example [http://example](http://example) [https://example](https://example) [http://www.example](http://www.example)
   [http://www.example](http://www.example) [https://www.example](https://www.example)
 * You’ll find updated code at the same URL here
 * [https://gist.github.com/wpmudev-sls/c96c180266795197c7ee3344b875b712](https://gist.github.com/wpmudev-sls/c96c180266795197c7ee3344b875b712)
 * so you just need to replace the code you already have with this new version.
 * Best regards,
    Adam
 *  Thread Starter [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * (@sebastianpetrovski)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17905001)
 * That’s awesome, thanks so much!
 * I just installed and tested and seems to be working fine.
 * Thanks again!
 * Sebastian

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘URL Validation requires http://’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popup/assets/icon-256x256.gif?rev=3446944)
 * [Hustle - Email Marketing, Lead Generation, Optins, Popups](https://wordpress.org/plugins/wordpress-popup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popup/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popup/reviews/)

 * 15 replies
 * 5 participants
 * Last reply from: [sebastianpetrovski](https://wordpress.org/support/users/sebastianpetrovski/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/url-validation-requires-http/#post-17905001)
 * Status: resolved