Why is my theme hacked?

Hi :frowning:

I have some messages from the Wordfence Scan saying the functions.php file of my theme fashionistas “appears to be malicious” and it’s hacked.

How did this happen and how do I fix it?
I go inside the file and there’s a lot of stuff written that makes no sense in the begining of the code lines.

Help me if you can… thanks in advance!

P.S.: my web is at http://uberblogged.com


Disable your plugins and check again please. Is the code different than what you see here: https://themes.trac.wordpress.org/browser/fashionistas/1.5/functions.php ?

Ok, I disabled my plugins and the code starts like:

$xdd2c04bd = create_function('$a',strrev(';)a$(lave')); 

(here comes a load of this same stuff above, like copy+pasted) and it ends like


All that is before the

2	/**
3	 * aThemes functions and definitions
4	 *
5	 * @package aThemes
6	 */

Yeah, that’s not right. Re-install the theme please.
Are you using any plugins that don’t come from the wordpress.org repository?

Ok… if I re-install will I lose all the changes and modifications I did to it?

I don’t know about the plugins question… How do I know?
I’m pretty sure most of it i’ve gotten it from Wordpress.

If you did custom code changes directly in the theme, then yeah, you’ll lose them. You won’t lose anything else. But you don’t really have a choice anyway. You could remove only the malicious code but that’s not very safe to do.

You need to remember if you installed plugins from other sources and remove them.
So re-install the theme and run Wordfence again please.

Ok, thank you!