# Can I change the URL of the main logo?

**URL:** https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127
**Category:** Development
**Created:** [April 8, 2021, 7:17pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127 "2021-04-08T19:17:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rodypl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodypl/32/215426_2.png) [@rodypl](https://meta.discourse.org/u/rodypl)
#### Post date: [April 8, 2021, 7:17pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/1 "2021-04-08T19:17:14Z")

</div>

For example, let’s say I wanted the logo to point to `forum.example.com/latest` instead of `forum.example.com`, how would I do that? Is that something I can change easily without needing a developer? Discourse is hosting my forum, if that makes any difference.

The reason I want that is because I want my default forum page when someone goes on the forum to be the “Categories” page so the forum is less intimidating. But I want them to go on the “Latest” page once they click on the logo.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 8, 2021, 7:52pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/2 "2021-04-08T19:52:43Z")

</div>

> [@rodypl](#):
>
> I wanted the logo to point to `forum.example.com/latest` instead of `forum.mysite.com`, how would I do that?

This should work in a theme:

```plaintext
<script type="text/discourse-plugin" version="0.4">
    api.changeWidgetSetting('home-logo', 'href', '/latest')
</script>

```

---

<div class="post-metadata">

### Author: ![rodypl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rodypl/32/215426_2.png) [@rodypl](https://meta.discourse.org/u/rodypl)
#### Post date: [April 8, 2021, 8:05pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/3 "2021-04-08T20:05:36Z")

</div>

Thanks! Since I’m a noob, could you specify where to paste this? I assume it’s not where the CSS goes?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 8, 2021, 8:07pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/4 "2021-04-08T20:07:31Z")

</div>

Goes into the HEAD section to the right of the CSS one. You can learn about it on [Developing Discourse Themes & Theme Components](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [March 18, 2023, 4:33am UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/5 "2023-03-18T04:33:20Z")

</div>

sorry for the necro, but how do i make this open into a new tab instead of self? is the target blank usable here?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [April 3, 2023, 2:49pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/6 "2023-04-03T14:49:00Z")

</div>

This takes a little more customization because it’s prevented in the home-logo widget here:

> <https://github.com/discourse/discourse/blob/2dbcea9eeeb816dda347027497b3a49634ef851f/app/assets/javascripts/discourse/app/widgets/home-logo.js#L140>

So you’d have to use `changeWidgetSetting` to set the URL, and then `reopenWidget` to add `_blank` and override the default click behavior that prevents it from opening in a new window.

```xml
<script type="text/discourse-plugin" version="0.8">
  const { h } = require("virtual-dom");

  api.changeWidgetSetting('home-logo', 'href', 'https://discourse.org');

  api.reopenWidget("home-logo", {
     html() {
       return h(
         "a",
         { attributes: { href: this.href(), "data-auto-route": true, "target": "_blank" } },
         this.logo()
       );
     },

     click(e) {
       return;
     },
   });
</script>

```

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [April 3, 2023, 3:15pm UTC](https://meta.discourse.org/t/can-i-change-the-url-of-the-main-logo/186127/7 "2023-04-03T15:15:25Z")

</div>

thank you for the excellent explanation. i sort of found a work around to what i was after by adding an icon link to the header with url to what i wanted the logo to go to and into another tab. it works and gave the users what they wanted in the end (the link to the external home site on the header). personally i prefer it the way it is because i like using the logo as my forum home link.
