# Change author url in WP to Discourse profile

**URL:** <https://meta.discourse.org/t/change-author-url-in-wp-to-discourse-profile/114687>\
**Category:** WordPress\
**Created:** [10.Апрель.2019 18:39:34 UTC](https://meta.discourse.org/t/change-author-url-in-wp-to-discourse-profile/114687 "2019-04-10T18:39:34Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![davidkingham](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidkingham/32/119528_2.png) [@davidkingham](https://meta.discourse.org/u/davidkingham)\
**Post date:** [10.Апрель.2019 18:39:34 UTC](https://meta.discourse.org/t/change-author-url-in-wp-to-discourse-profile/114687/1 "2019-04-10T18:39:34Z")

</div>

I would like to change the author link in wordpress posts:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/4/f44c05e437e77d9bd175f86d6fcbc62dda786b4d.png)

To link to the authors profile in Discourse. I found this snippet which is similar to what I want to achieve, I modified it slightly.

```plaintext
  add_filter( 'author_link', 'change_author_link', 10, 1 );

  function change_author_link($link) {
   $username=get_the_author_meta('user_nicename');

  $link = 'https://community.naturephotographers.network/u/' . $username;
   return $link;
 }

```

But I don’t know how to retrieve the discourse username from wordpress, the `get_the_author_meta('user_nicename');` is what’s tripping me up. Thanks!

---

_[View the full topic](https://meta.discourse.org/t/change-author-url-in-wp-to-discourse-profile/114687)._
