Title: youtube Embed with hyperlink
Last modified: February 5, 2018

---

# youtube Embed with hyperlink

 *  Resolved [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/)
 * hello
 * I turned my database from vBulletin to WordPress, everything okay just on YouTube
 * Links like this
 * `<a href="https://www.youtube.com/watch?v=cVT5pH2umyQ">https://www.youtube.com/
   watch?v=cVT5pH2umyQ</a>`
 * for example : [http://www.dreams-image.com/wp/green-shoes/](http://www.dreams-image.com/wp/green-shoes/)
 * I know it should be none of hyperlink to working
 * What Modifications are needed to work ?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fyoutube-embed-with-hyperlink%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9938893)
 * Do you have WP-CLI installed? It has a search/replace function that can handle
   regular expressions.
    [https://developer.wordpress.org/cli/commands/search-replace/](https://developer.wordpress.org/cli/commands/search-replace/)
 * If not there might be a plugin out there that can do it.
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939007)
 * I can install it
    Can you help me more What are the Command for the required 
   work
 *  [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939070)
 * Ok 1st make a **BACKUP**.
 * `wp search-replace '(<a href="https:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-
   9]+).*<\/a>)' 'https://www.youtube.com/watch?v=\2' wp_posts --regex --dry-run`
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939201)
 * Great, thank you
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939250)
 * my Brother
    Only some links that contain symbols such as “_” and “-” like this
 * `<a href="https://www.youtube.com/watch?v=_BD_DaYOWWE">https://www.youtube.com/
   watch?v=_BD_DaYOWWE</a>`
 * What change is needed to work
 *  [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939257)
 * Add them to your match `[a-zA-Z0-9]` so `[a-zA-Z0-9_-]`
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939298)
 * Thank you so much again
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939715)
 * my Brother
    There is a problem with links that contain “_” and “-”
 * the output is incorrect
 *     ```
       Example https://www.youtube.com/watch?v=7-xjF0LBDHY
       Will be https://www.youtube.com/watch?v=7
       ```
   
 *     ```
       And  https://www.youtube.com/watch?v=HzhC-lO4wpu
       Will https://www.youtube.com/watch?v=HzhC
       ```
   
 *     ```
       https://www.youtube.com/watch?v=DG4tEsbf_G8
       https://www.youtube.com/watch?v=DG4tEsbf
       ```
   
    -  This reply was modified 8 years, 3 months ago by [dreamsers](https://wordpress.org/support/users/dreamsers/).
    -  This reply was modified 8 years, 3 months ago by [dreamsers](https://wordpress.org/support/users/dreamsers/).
    -  This reply was modified 8 years, 3 months ago by [dreamsers](https://wordpress.org/support/users/dreamsers/).
    -  This reply was modified 8 years, 3 months ago by [dreamsers](https://wordpress.org/support/users/dreamsers/).
 *  [Simon Prosser](https://wordpress.org/support/users/pross/)
 * (@pross)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9939796)
 * You likely forgot to escape the `-`.
    `wp search-replace '(<a href="https:\/\/
   www\.youtube\.com\/watch\?v=([a-zA-Z_\-0-9]+).*<\/a>)' 'https://www.youtube.com/
   watch?v=\2' wp_posts --regex --dry-run`
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9940209)
 * It works. I am grateful to you
 *  Thread Starter [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * (@dreamsers)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9940311)
 * Now just something simple if you allow
    I want to make <br /> in new line
 * `https://www.youtube.com/watch?v=JPkEzwjC9zE<br />`
 * to
 *     ```
       https://www.youtube.com/watch?v=JPkEzwjC9zE
       <br />
       ```
   
    -  This reply was modified 8 years, 3 months ago by [dreamsers](https://wordpress.org/support/users/dreamsers/).

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘youtube Embed with hyperlink’ is closed to new replies.

## Tags

 * [hyperlink](https://wordpress.org/support/topic-tag/hyperlink/)
 * [vbulletin](https://wordpress.org/support/topic-tag/vbulletin/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 2 participants
 * Last reply from: [dreamsers](https://wordpress.org/support/users/dreamsers/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/youtube-embed-with-hyperlink/#post-9940311)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
