esc_url is the correct function to escape links -> https://codex.wordpress.org/Function_Reference/esc_url – if it’s not working correctly then double check the actual output of your variables to make sure they are in fact links.
But selling links in your themes via “sponsored” links is not something I would ever recommend anyone doing which from the code it looks like you are doing. “Powered by” should be followed by “WordPress”. And maybe even “developed by Your Name” – but selling links in themes just makes them look spammy and untrustworthy (my 2 cents).
Related Posts:
- How to check if a string is a valid URL
- 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?
- 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?
- Check if current page is the Blog Page
- WordPress Visual Editor Stripping HTML Changes
- How to remove hardcoded characters from playlists?
- PHP function showing wrong time in WordPress
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- conditional statement expressing that current user didn’t logout (is still in the same login session)?
- Adding Image Count to Multigallery
- is_page(id) not working for blog page
- PHP Customization: Taxonomies and Queries, why? [closed]
- How to clear WordPress Cache from Server/FTP/Remote location
- Get ID of child from child slug, while knowing parent ID
- Is there a built in function to see if a URLis oEmbed Compatible?
- How to get media objects
- Why use the Settings API over a new administration menu?
- How does this WordPress Plugin (Thrive Comments) apply their custom comment sort? [closed]
- Only Show Link If div Exists
- A solution to set metatags with my page generating plugin?
- Maximum file upload limit in php.ini have no effect on wordpress
- Change the WP Video Shortcode Output
- Output ACF repeater on frontend user’s profile page (created with Ultimate Member) [closed]
- Validate functions before inserting then into functions.php
- How to get all first images of posts in same category?
- Why does wordpress only look at certain child theme pages, but not all of them?
- Incorrect MIME type for assets with Valet
- My php header() function is not working [closed]
- Can you use a WordPress front-end only and have rest of pages as pure PHP
- Security: blocking direct access of php files
- Woocommerce Show Single Product on Homepage
- Woocommerce change prices for a certain country [closed]
- Adding PHP in the menu
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Display Data in Table from External Database in WP using Shortcodes
- persist a variable set in header.php all the way down to footer.php
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- Remove item in Checkout
- How to Update post_modified of all wordpress post
- Woocommerce – get_items() returns empty array
- echo esc_url( get_permalink($post->ID) + complete the ID’s url
- How to add a rewrite endpoint to unattached media?
- WordPress cron is running with previously set time intervals and not the updated one
- Accessing an API with jQuery and AJAX
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Good RSS Feed Parser to use on php file?
- Obfuscate links (for SEO purpose) [closed]
- Sortable custom product taxonomy terms via drag and drop
- get value from get_post_meta then reuse it in another get_post_meta
- How to remove Login from in my account page
- Header is not displaying on certain pages of wordpress theme [closed]
- Retrieve the whole widget sidebar and pass it inside an html
- Configure WordPress to Use Responsive Image Rendering
- Creating multiple tables with Plugin
- How to access specific product id on other pages/posts?
- How can i create a function tag in my plugin
- ACF – Get ID of relationship field in flexible content
- Why the responseText containing those two arrow signs at the beginning
- Return newly created category by code
- Meta Box clears saved field content
- Woocommerce remove menu item on myaccount dashboard
- Hook into all password resets in WordPress and get password before hashing?
- WordPress select query issue
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- woocommerce plugin bugs
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Getting most popular posts based on Facebook comments count
- WordPress get_post_meta issue
- Woocommerce Price Text
- Display pages from specific page template
- If Elseif Query
- Querying multiple meta_keys in WordPress SQL query
- 3 domains, 1 wordpress install, redirecting and changing domains on live site
- How can I print out a single stylesheet or javascript link?
- Cannot Upload Custom Header Image into WordPress Dashboard
- wordpress featured image
- Generating a number based on post ID
- Add comma between variables [closed]
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- Disable Typed Parameters for JavaScript in PhpStorm? [closed]
- Properly process a custom WP REST API request (Authenticate, Authorize + Validate)?
- Losing Session ID and sessionStorage when navigating to other domains on Multisite
- Contact form with dynamic dropdown and filter
- Show the terms of the hierarchical taxonomy
- Why does WordPress not make use of gettext directly?
- i18n in WordPress Theme
- Warning: Undefined variable $post_id