Is it possible to hide ip address field from profile page using CSS?


Have a look at the below image

The 2 fields:
Last IP address
Registration IP address

These two fields are available for both the admins as well as moderators, when they view anyones user profile.

Is there any way to hide these using CSS?

I don’t think they have any unique class so I’m guessing there is no easy to hide it using CSS.

Can we adopt any other approach to hide these?
If anyone have any suggestions - please share.

(Joshua Rosenfeld) #2

Odd that we have specific classes on some rows but not others.


@codinghorror any objection to adding specific classes to each row?

(Jeff Atwood) #3

I object to adding it to every row “just because”, because I hate speculative work. But if there is a legitimate need for certain rows to have it, then that seems OK.

(Vinoth Kannan) #4

Maybe you have to do it by overriding templates via theme instead of CSS.

(Joshua Rosenfeld) #5

OK, adding classes to just the IP address rows for now.

Edit: Commit submitted

(Vinoth Kannan) #7

Very good idea @lll. But why this much complex code? It can be like below

.admin-contents.admin-users {
  section.details:first-of-type {
    > div:nth-child(9), > div:nth-child(10) {
      background: red

(Joe) #8

:grin::ok_hand: definitely yes @vinothkannans simple is better!

Sometimes I just get carried away :grimacing:


(Vinoth Kannan) #9

@nixie FYI, as per Joshua’s commit you can use newly added CSS classes .last-ip and .registration-ip.

(Hunter Ray) #10

For those from google looking for the css code:

.last-ip, .registration-ip {
    display: none;

Note that this will not really hide the IP address from being sent to the admins’/moderators’ browsers, as the CSS only hides the element; the IP address is still there if they were to inspect element.

(Sam Saffron) #11