Home › Forums › Front-end Issues › Remove 'http://' from text fields › Reply To: Remove 'http://' from text fields
@blueli The http(s)://
is the protocol part of the URL; it tells the browser that it’s an external link. An href
without a protocol is treated as an internal link.
If you’re removing the protocol for display reasons, you should save that to a separate variable instead.
Also, if you want to remove trailing slashes, there is a native WP function called untrailingslashit()
or trailingslashit()
for the opposite effect.
Good luck!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.