On input, esc_url_raw() is the correct function to use which replaces sanitize_url
Example :
$custom_field = esc_url_raw( get_post_meta( get_the_ID(), '_custom_url', true ) );
Related Posts:
- Add validation and error handling when saving custom fields?
- How to store the value of a custom field dropdown select for post referencing?
- Get updated meta data after save_post hook
- Check before publishing, if already exist post with current custom field value
- Check if the value of a field has changed on save_post
- Support auto-save and revisions for custom fields
- Get updated meta value after post update or published (custom post type) using hook
- custom-meta-box checkboxes from loop won’t save
- Saving Custom Field Data before Publish
- Allow only one post with specific meta value
- What is the proper way to add a required field to a post type? [duplicate]
- Custom metabox not displaying multiselect data in edit mode
- How to validate select field in post meta?
- frontend submit post jQuery clone row won’t save
- Can wp_insert_post_data filter be used to save custom field data?
- Use value from ACF to populate other fields
- update a custom field with the value of another existing custom field
- adding autosave feature to custom fields
- Why WordPress takes time to make request to save post?
- Custom fields and auto save
- Saving metadata of related post on save_post
- added a meta box to post however when saving menu while debug on throws a warning
- Multiple triggers when publishing, saving or updating a post in WordPress
- Set post status to draft after validating post meta values in save_post hook
- Is there a way to set default custom fields when creating a post?
- Underscores in custom fields
- Add custom field to the archive page?
- Show only posts which can be commented OR have custom meta field
- Need small coding with Custom Fields Search
- How do I make a custom field choose an image?
- get_post_meta() unserialize issue – returns boolean(false)
- How can I remove fields in the attachment editor?
- Unable to get Preview of Uploaded image within a Custom Meta box
- Edit Custom Database Tables in WordPress
- Change content before writing to database
- post meta data clearing on autosave
- WordPress Search Custom Meta Field Only
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Add description text under input field for new profile fields
- Which is best in the following scenario : post_meta vs custom table vs parent/child posts
- Echo values from custom field outside loop php
- How to add content at the end of posts?
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Complex WP_User_Query call fails on production server
- How to query posts with certain custom meta data, and output Post data
- Custom Fields Not in Search Results
- wordpress custom fields multiple data
- How do I define post titles as images using Custom Fields?
- Get an advanced custom field after post publish
- Why the pagination for a query modified by pre_get_posts doesn’t mind the number & order of posts sorted & selected based on a custom date time field
- Trying to update_post_meta function
- How do i add custom fields to my themes template file?
- Custom Field to a Role?
- Pull custom fields from custom posts within a loop
- Ordering posts by custom field named “date” in backend
- How to pass page as an argument like post in WordPress?
- How to display custom fields from a plugin
- Adding “meta” info to WP site PHP function?
- WordPress Media Uploader custom Javascript not working
- Custom fields issue [closed]
- Select custom posts by meta_value and sort by a different meta value
- List custom queried terms in the edit-tags.php?taxonomy page
- Front end register with custom fields
- Display custom field from the front page on another page
- No result update a custom field using wp_schedule_event
- Display custom widget value in header.php
- Gravity Forms Update post meta from template [closed]
- Automatic linking terms
- Adding extra fields to front end signup form
- Problem uploading different files as custom fields with front end post form
- How to change order of posts in admin
- wpdb function insert doesn’t work
- make a dropdown custom field with ‘cities’ list in it
- How can I modify my meta_query to work with prices that are stored in the database that contain dollar signs and commas?
- Get Custom Field Name ( Label or Key ) Not Value
- Custom field on Quick Edit using select/dropdown – almost working right but not showing currently selected value
- Move the metaboxes to the very top of post editor
- Custom User Dashboard
- Custom Fields not working properly
- Custom meta POST request fired twice when updating a post in Gutenberg
- add meta box considers the selected option as post parent
- How do I display a custom field in an existing form on the front end?
- How to save array option as text and not integer?
- Extend WP_User_Query or WP_User to return all custom fields?
- Quicktag button to automatically add a custom field to a post
- Display custom fields only if it has a value
- Generate slug and meta data if meta field is empty
- WordPress taxonomy child image
- Create custom fields/meta data gender+country – radiobuttons and dropdown on register screen for these fields
- Add nofollow to custom field link and make domain exceptions?
- wordpress simple post multi rating with post_meta and user_meta
- Custom fields are not displaying in page with multiple loops
- Add class from custom field into widget class
- Download stuff after filling fields?
- Adding custom field to Lightbox in header only pulls current page data, not Lightbox item data
- Meta boxes not displayed, data isn’t being saved
- Custom registration form and custom field
- How can i put a custom field inside this php
- Conditional display based on ACF checkbox
- How to add an ACF only for parent term?