Title: p tag added when using href with variable
Last modified: August 24, 2016

---

# p tag added when using href with variable

 *  [Neo_dev](https://wordpress.org/support/users/neo_dev/)
 * (@neo_dev)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/p-tag-added-when-using-href-with-variable/)
 * Hello,
 * I’m trying to add an external link to a page but wordpress adds a <p> before 
   and after the url so my link is part of the self site url.
 * I get an external url (ex: `http://www.myurl.com`) from a field (ex:field_3008)
   in the database:
    $myurl = apply_filters(‘the_content’, $this->myplugin[‘current’][‘
   data’][field_3008]);
 * then when using:
    `<a href="<?php echo $myurl; ?>">mylink</a>`
 * I’m expecting the link to be: ‘[http://www.myurl.com&#8217](http://www.myurl.com&#8217);
   but I get `http://www.mywordpress_site.com/myurl.com`
 * I tried the following: `<a href="//<?php echo $myurl; ?>">mylink</a>`
    but it
   doesn’t work. I realized that wordpress adds <p> before and after `http://www.
   myurl.com` Any idea of how to make it work?
 * Thank you!

The topic ‘p tag added when using href with variable’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Neo_dev](https://wordpress.org/support/users/neo_dev/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/p-tag-added-when-using-href-with-variable/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
