Title: Insert target=&#8221;_blank&#8221;
Last modified: December 13, 2019

---

# Insert target=”_blank”

 *  [vvillarin](https://wordpress.org/support/users/vvillarin/)
 * (@vvillarin)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/insert-target_blank/)
 * Hello, this is my first post so please bear with me.
 * I am editing the code (shown below) in the wp-includes/post-template.php file
   to add target=”_blank” so that the link will open to a new window but I keep 
   getting syntax error.
 * `$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink(
   $_post ) . "#more-{$_post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text);`
 * Could you please tell me where should I insert the target=”_blank” ?
 * Thanks in advanced.
 * Victor
    -  This topic was modified 6 years, 6 months ago by [vvillarin](https://wordpress.org/support/users/vvillarin/).
    -  This topic was modified 6 years, 6 months ago by [vvillarin](https://wordpress.org/support/users/vvillarin/).

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

 *  [baranwal](https://wordpress.org/support/users/baranwal/)
 * (@baranwal)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/insert-target_blank/#post-12234857)
 * Hi vvillarin,
 * Please try below code may be it can help you-
 * `$output .= apply_filters( 'the_content_more_link', '<a href="' . get_permalink(
   $_post ) . '#more-{$_post->ID}" target="_blank" class="more-link">$more_link_text
   </a>', $more_link_text )`
    -  This reply was modified 6 years, 6 months ago by [baranwal](https://wordpress.org/support/users/baranwal/).
    -  This reply was modified 6 years, 6 months ago by [baranwal](https://wordpress.org/support/users/baranwal/).
    -  This reply was modified 6 years, 6 months ago by [baranwal](https://wordpress.org/support/users/baranwal/).
 *  Thread Starter [vvillarin](https://wordpress.org/support/users/vvillarin/)
 * (@vvillarin)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/insert-target_blank/#post-12235643)
 * Thanks for your time Barawal, I really appreciate your effeort to look into the
   code.
    I just added ; at the end of the code because it is showing syntax error
   without it then saved it with no issue.
 * Unfortunately, the link is still not opening as a new window. 🙁

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

The topic ‘Insert target=”_blank”’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [vvillarin](https://wordpress.org/support/users/vvillarin/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/insert-target_blank/#post-12235643)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
