Use the native php function Filter Validator
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
die('Not a valid URL');
}
Related Posts:
- What is the best practice for escaping data URIs?
- Shortcode putting html such as
- Validate Uploaded Image using WordPress’ Built-in Functions?
- Settings API – sanitize_callback is not called and it leads to an incorrect behavior
- How to remove role=”navigation” from all nav elements?
- What esc_ to use to validate this?
- Sanitizing text fields in array
- register_setting & add_settings_error validation issues with multiple fields
- WordPressUser Submission Form
- Contact form – problem with displaying message about sent mail
- Contact Form 7 WordPress, checking a few fields, if empty then invalid
- Custom HTML form using PHP – help with ajax/username validation
- WP Debug enabled Undefined index error in a widget
- Custom Registration and Login Forms with reCaptcha 2 Validation
- why is kses removing semicolon from inline style?
- oneOf JSON Schema validation not properly working for custom post meta value?
- Inline style to PHP [closed]
- How to get Post Type from the functions.php file
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- Asynchronous multiple requests 401 Unauthorized
- Get the URL of the page from which an ajax request has been launched within ajax callback
- Edit the_category (); for a hierarchical display
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- Hide a div when tags doesnt exist [duplicate]
- Division by zero error in image.php
- What does -> mean in WordPress?
- How to have different header.php based on the user logged in?
- How do I remove a category from a wordpress loop>
- First Byte Time (back-end processing)
- How do I include SVG file used as featured image?
- Return product description
- How to add the sidebar to all the pages except the home page? [closed]
- Header not properly displaying on archive.php
- Adding regular php file to site
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- Remove slugs from custom posts type
- Generate CSV file and add data as a new wordpress custom post
- Simple jQuery AJAX Request fails to run PHP Script
- Update if post with specific title exists
- child parent styles enqueue order
- Trying To Get Child Categories To Show, Issue With foreach Loop
- Add URL parameter to all internal links using a specific theme
- Pass important values server-side when processing form
- Call featured image url
- pass html code to worpdress
- Use an anchor link to open an iframe inside a WordPress page
- Can ‘Custom Field’ data be inserted into this Short Code?
- In WordPress, how do you make several different editors for a single page?
- Merge 2 product attribute terms
- How do I reset $wp_query in a function?
- Add class to all img if they have a certain ACF field
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- How can I check that the acf field value is not a duplicate when adding a post?
- Add a product category to a specific product via a button
- How to update custom fields when post is published?
- Trouble Accessing Gravity Forms API (GFAPI)
- How do I stop an Image Address from loading in the Browser?
- Add class to image in php
- Creating a checklist with ACF and I cannot figure out how to add all iterations to an array that I’m creating
- Add a default style if no Featured image is selected
- How does one make a URL return dynamic JSON with custom Content Type?
- custom-header not working
- Need to forward Data from WooCommerce Webhook sent to same site WordPress REST API custom endpoint
- Add Product Permalink in woocommerce admin order page
- Proper use of Output Buffer for a whole php clas
- How do I make comment-reply-button with that takes to comment reply form on click
- missing admin bar and widget in a template
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- How to load WP_Editor JS files manually (with AJAX)?
- My own theme’s custom widget areas are not working
- Querying posts from wordpress with 2 or more conditionals
- How to apply filter
- Importing demo data in Multisite
- Allow BBPress participant role to trash topics
- How to find the function which is outputting Array
- Manipulate database of WordPress site with my own scripts
- How can I include a file related to blog URL? Nothing seems to work
- How to export database correctly for local to online
- Where are Sessions are being started? [closed]
- Setting field not saving on front-end
- Get the current page in a call back function
- Getting custom field data from cart page to checkout page in woocomerce [closed]
- PHP Use Declared array Variable inside already Declared Array
- How to create and add js and css file when server is not on my PC?
- Object of class WP_Post could not be converted to string while trying to console.log wp_get_nav_menu_items
- Check radio get value to array
- php grabbing every post made?
- Running a php code after User clicks a button? [closed]
- Too few arguments at registering new templates in my plugin
- inner-wrap div pushing custom table far down on page
- Remove Woocommerce product from cart with ajax/fetch
- Automatically change insurance quantity based on cart total [closed]
- I want to lists posts in wordpress to nearest location entered by the user
- How to edit a widget code?
- Hide ‘Downloadable’ and ‘Virtual’ checkbox options from Woocommerce Variations?
- Nav Menu Short code Not working When non Login
- Loading a wordpress shortcode in JS
- How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
- id for categories and products