Title: Website hacked after putting some code in Function.php file
Last modified: August 31, 2016

---

# Website hacked after putting some code in Function.php file

 *  [abhishek1982](https://wordpress.org/support/users/abhishek1982/)
 * (@abhishek1982)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/)
 * Hello,
 * My website is Sportstadka.com
    I was trying to add additional sidebar to my site
   and copied code this code into my functions.php from one site appointzilla.com
   here is the code I copied –
 *  if ( function_exists(‘register_sidebar’) ) {
 *  register_sidebar(array(
 *  ‘name’ => ‘Custom Sidebar’,
 *  ‘id’ => ‘custom-sidebar’,
 *  ‘description’ => ‘Sidebar below Header image’,
 *  ‘before_widget’ => ‘<li id=”%1$s”>’,
 *  ‘after_widget’ => ”,
 *  ‘before_title’ => ‘<h2>’,
 *  ‘after_title’ => ‘</h2>’,
 *  ));
 * }
 * But after copying code my site is gone and getting this error on my homepage ..
   Parse error: syntax error, unexpected ‘2’ (T_LNUMBER) in /home/content/n3pnexwpnas02_data02/
   60/2904760/html/wp-content/themes/sportsmag/functions.php on line 366
 * Kindly help ..

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Moderator [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298322)
 * The message you got indicates that you have code with invalid syntax; it does
   not suggest that your site was hacked.
 * Remove the code you added and the error message should no longer appear.
 * see [https://codex.wordpress.org/Sidebars](https://codex.wordpress.org/Sidebars)
   for details of how to add a sidebar to a theme. In addition to code to register
   the sidebar, you will also need to add code to display it.
 *  Thread Starter [abhishek1982](https://wordpress.org/support/users/abhishek1982/)
 * (@abhishek1982)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298332)
 * Thanks cubecolour for your response. However I’m not able to log on to my site
   itself. Everytime I put my site name sportstadka.com on browser window , it’s
   redirecting me directly to the error page. Not sure how to get into my admin 
   panel !!
 *  Moderator [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298334)
 * Use an ftp client application such as filezilla on your computer to connect to
   your site files and use a text editor to make the required chages
 *  Thread Starter [abhishek1982](https://wordpress.org/support/users/abhishek1982/)
 * (@abhishek1982)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298482)
 * Thanks , Could you be little more specific in terms of connecting to site files.
   Are you saying Using FTP , I can unload files of my site to my local machine (
   surely need to provide server details ?) and correct the files and upload to 
   site back again ?
 *  Thread Starter [abhishek1982](https://wordpress.org/support/users/abhishek1982/)
 * (@abhishek1982)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298483)
 * [http://sportstadka.com](http://sportstadka.com) , this is my site and the error
   which i’m getting on homepage … do I need to get in touch with my host to resolve
   this issue .

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Website hacked after putting some code in Function.php file’ is closed
to new replies.

## Tags

 * [website hacked](https://wordpress.org/support/topic-tag/website-hacked/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [abhishek1982](https://wordpress.org/support/users/abhishek1982/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/website-hacked-after-putting-some-code-in-functionphp-file/#post-7298483)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
