I've been working on a project which keeps getting some PHP inserted into the config.php file and it's causing a lot of issues with SEO. I'll paste in a sample of it (it's quite long) after this intro. I've removed it several times, changed the FTP password, admin password and username, the SALTs and checked the .htaccess - beyond that I'm stuck. Any idea how to solve this?

Part of the code, the middle cut down a lot;

  • I think, for once, I've just found the solution right away. I've found a php file in the uploads directory. Damn hacker! I'll get rid of this and change all passwords again, hopefully that will solve this! – Dan Jan 6 '14 at 19:06
  • 1
    A fresh install would be better. There might be more files! – sakibmoon Jan 6 '14 at 19:12

You can move the wp-config file one level up.

You can also create a .htaccess file and upload it to your uploads folder with this code:

<Files ~ ".*..*">
Order Allow,Deny
Deny from all
<FilesMatch ".(jpg|jpeg|jpe|gif|png)$">
Order Deny,Allow
Allow from all

Or install a plugin for security which also scans your installation so you can more easily find the malicious code. http://wordpress.org/plugins/wordfence/

More security . http://codex.wordpress.org/Hardening_WordPress

| improve this answer | |
  • Thanks Brad, this looks like good advice. I need to have a chat to the client about this... – Dan Jan 7 '14 at 7:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.