# Differentiate Admin and Moderator Shield Icons

**URL:** https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114
**Category:** UX
**Created:** [January 9, 2019, 9:21pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114 "2019-01-09T21:21:33Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 11, 2019, 3:43am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/28 "2019-01-11T03:43:39Z")

</div>

Given the surprising level of difficulty, maybe we should just leave this be.. not like it is broken the way it is.

---

<div class="post-metadata">

### Author: ![cosdesign](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cosdesign/32/208585_2.png) [@cosdesign](https://meta.discourse.org/u/cosdesign)
#### Post date: [February 3, 2021, 10:52pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/29 "2021-02-03T22:52:47Z")

</div>

I know it’s late but I just want to share my solution to display that admin crown ( so far only on topic’s page ) by using CSS and JS. I could also use some help cause for some reason my js code is not working..I can see it in that inline theme js file but still not working ( works well on jsfiddle though )

 ![SSd](https://global.discourse-cdn.com/meta/original/3X/b/2/b2fc83054552242d735a4551e5e2d37bc8da1c51.jpeg)

CSS

```
.names span.admin a::after {
content: "";
width: 17px;
height: 14px;
margin-left: 5px;
background-image: url(https://www.dropbox.com/s/0oi0y3ex3rtfvk5/cd-crown.svg?raw=1);
background-repeat: none;
display: inline-block;
position: relative;

```

}

JS ( to display the title on hover - but as I said is not working when I include it inside )  
Working [Jsfiddle demo](https://jsfiddle.net/pkx34ohv/)

```
var cdcrowntitle = document.querySelector(".names .admin a");
cdcrowntitle.setAttribute("title", "Community Admin");

```

---

<div class="post-metadata">

### Author: ![dandv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dandv/32/169779_2.png) [@dandv](https://meta.discourse.org/u/dandv)
#### Post date: [June 2, 2023, 6:20pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/30 "2023-06-02T18:20:23Z")

</div>

Got the same feedback from one of our moderators. Any progress/ideas on differentiating the admin/moderator icons in the past 2 years?

---

<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: [June 2, 2023, 6:35pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/31 "2023-06-02T18:35:53Z")

</div>

didn’t see it anywhere in this topic but i use CSS on my forum to make different colored shields for mods and admins for posts (if admins are members of moderator groups). in my case, mods get gold shields and admins get grey. but one can use any color in those color properties of course.

common css

```scss
// * change shield color in posts differentiating admin and mod users* //

span.username {
  &.moderator .d-icon.d-icon-shield-alt {
    color: #d5b907;
  }
  &.admin .d-icon.d-icon-shield-alt {
    color: #969696;
  }
} 

```

i haven’t bothered to do it for user cards or profiles but i suppose i could figure it out.

you can also change the color of the moderator and admin usernames in posts to distinguish them further:

```scss
// *change color of usernames differentiating admins and mods* //

span.username {
  &.moderator a {
    color: #d5b907;
  }
  &.admin a {
    color: #969696;
  }
} 

```

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [January 13, 2025, 1:24am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/32 "2025-01-13T01:24:54Z")

</div>

The shield color change didn’t work- it still looked the same grey for both. Has the selector changed since this was posted?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [January 13, 2025, 7:00am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/33 "2025-01-13T07:00:21Z")

</div>

Possibly. A quick inspect of the page can help you determine the class.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 13, 2025, 10:03am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/34 "2025-01-13T10:03:15Z")

</div>

The icon is now named `d-icon-shield-halved`.

---

<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: [January 13, 2025, 12:22pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/35 "2025-01-13T12:22:35Z")

</div>

yea icon name changed so it should be like this

```css
span.username {
  &.moderator .d-icon.d-icon-shield-halved {
    color: #d5b907;
  }
  &.admin .d-icon.d-icon-shield-halved {
    color: #969696;
  }
}

```

result

 ![IMG_2061](https://global.discourse-cdn.com/meta/original/4X/b/3/c/b3c92dd63f9abf9515f4a31ae79d3b4b93d1af30.jpeg)

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [January 13, 2025, 12:51pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/36 "2025-01-13T12:51:11Z")

</div>

Thanks Lilly! And… CocoQuark, however you spell that.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [January 15, 2025, 5:20am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/37 "2025-01-15T05:20:51Z")

</div>

> [@Lilly](#):
>
> yea icon name changed so it should be like this
> 
> ```css
> span.username {
> &.moderator .d-icon.d-icon-shield-halved {
> color: #d5b907;
> }
> &.admin .d-icon.d-icon-shield-halved {
> color: #969696;
> }
> }
> 
> ```

Just wondering if we wanted to swap say the admin icin with the Wizard hat would swap color with display none and then add a line with the .d-icon.d-icon-wizard? (Not sure of the wizard hat fa off hand)

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [January 15, 2025, 1:23pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/38 "2025-01-15T13:23:36Z")

</div>

The fa is:  
fa-solid fa-hat-wizard  
So what would the css be, then? If I wanted to change the admin icon to hat-wizard?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 15, 2025, 1:45pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/39 "2025-01-15T13:45:43Z")

</div>

> [@Turtle](#):
>
> So what would the css be, then? If I wanted to change the admin icon to hat-wizard?

The same CSS.  
The class will still be `d-icon-shield-halved` regardless of the icon you replaced with, if you use this replacement method:

> [@Replace Discourse's default SVG icons with custom icons in a theme](https://meta.discourse.org/t/replace-discourses-default-svg-icons-with-custom-icons-in-a-theme/115736):
>
> You can replace a Discourse’s default SVG icons individually or as a whole with your own custom SVG and override them [within a theme or theme component.](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966#create-new-themes-and-theme-components-7)Step 1 - Create an SVG Spritesheet To get started, you must create an SVG Spritesheet. This can contain anything from a single additional custom SVG icon up to an entire replacement set of hundreds. The spritesheet should be saved as an SVG file. In principle, you are nesting the \<svg\> tag contents from the original SVG icon file into \<symbol\> …

---

<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: [January 15, 2025, 2:44pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/40 "2025-01-15T14:44:04Z")

</div>

Easiest way to do this is like with the [same code as above](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/35), but also icon replacement code in head-tag tab like this:

 ![Screenshot 2025-01-15 at 6.41.46 AM](https://global.discourse-cdn.com/meta/original/4X/d/8/6/d8631b03ec304eee657ba08b05023eaeed4ac806.png)

in

```js
<script type="text/discourse-plugin" version="0.8"> 
  
  api.replaceIcon('shield-halved', 'hat-wizard')

</script>

```

result:

 ![Screenshot 2025-01-15 at 6.43.24 AM](https://global.discourse-cdn.com/meta/original/4X/1/c/b/1cbe45f5ee427ba09a3604991ec4faebf6892c81.png)

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [January 15, 2025, 2:48pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/41 "2025-01-15T14:48:28Z")

</div>

Will it work so admins can have the hat and moderators the shield? Or does it just replace all of them like in the picture, and if so, is there a way around it?

---

<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: [January 15, 2025, 2:51pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/42 "2025-01-15T14:51:31Z")

</div>

well you might be able to [hack a conditional css](https://meta.discourse.org/t/making-custom-css-changes-on-your-site/168101) or some code in the script there. but that is icon replacement for all.

---

<div class="post-metadata">

### Author: ![Turtle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/turtle/32/476220_2.png) [@Turtle](https://meta.discourse.org/u/Turtle)
#### Post date: [January 15, 2025, 7:18pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/43 "2025-01-15T19:18:32Z")

</div>

Actually, not even the wizard icon is working right now. I used the exact code in the head you gave me.  
I can try again, maybe it was a glitch or something.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 15, 2025, 7:35pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/44 "2025-01-15T19:35:37Z")

</div>

Did you add the wizard hat icon in the `SVG icon subset` site setting?

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

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [January 15, 2025, 8:15pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/45 "2025-01-15T20:15:39Z")

</div>

This is an OT question, but I would like to keep halfshield for mods. But I would very much like to show the wizard hat with admins \[1\]

But I can’t replace half shield with the hat, because of moderators.

Oh god…

> [@Turtle](#):
>
> Will it work so admins can have the hat and moderators the shield? Or does it just replace all of them like in the picture, and if so, is there a way around it?

I really should start reading topics 🤦‍♂️ Sorry.

* * *

1. I have few middle aged women in my forum, and they are Potter fans; that would annoy them so much 😂

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [January 15, 2025, 8:34pm UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/46 "2025-01-15T20:34:40Z")

</div>

> [@Lilly](#):
>
> i haven’t bothered to do it for user cards or profiles

On my forum it shows only on user card and profiles, but not on topics.

Any idea what I’ve done again?

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [January 17, 2025, 10:23am UTC](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114/47 "2025-01-17T10:23:21Z")

</div>

Shield svgfor revised code.

> [@Lilly](#):
>
> yea icon name changed so it should be like this
> 
> ```css
> span.username {
> &.moderator .d-icon.d-icon-shield-halved {
> color: #d5b907;
> }
> &.admin .d-icon.d-icon-shield-halved {
> color: #969696;
> }
> }
> 
> ```
> 
> result
> 
> ![IMG_2061](https://global.discourse-cdn.com/meta/original/4X/b/3/c/b3c92dd63f9abf9515f4a31ae79d3b4b93d1af30.jpeg)

[Previous page](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114.md?page=1)

[Next page](https://meta.discourse.org/t/differentiate-admin-and-moderator-shield-icons/106114.md?page=3)
