Getting WordPress to work on GoDaddy’s free hosting account…finally!

Aye….another failed attempt.  Close.   If someone can provide some suggestions, I think we can get there….

Tested in Firefox 3.6.6  Does not work in Chrome.  IE….won’t even try.

It took me a few tries….okay, a bunch of tries, but in the end it’s a really simple fix to get WordPress 3.0 to work on GoDaddy’s free hosting account.

From my experience, I have not had any issues on the front end of wordpress, it is only the admin that breaks.

To fix this, you’ll have to edit some files, but it’s not a big edit.

To get started, open up wp-admin/index.php

Change the top of index.php file to look like this:

<?php

ob_start();

/**

* Dashboard Administration Panel

All we’ve done here is add the line ob_start();

Next, at the very, very bottom of that page…I mean the very bottom, put the following code:

<?php
$buffer = ob_get_contents();
ob_end_clean();
$buffer = str_replace(array(‘<html>’, ‘</html>’), ”, $buffer);
$handle = fopen(“./temp.html”, ‘w+’);
fwrite($handle, $buffer);
fclose($handle);
?>
<script type=”text/javascript”>
$(document).ready(function() {
$(“head”).remove();
$(“body”).remove();
$.get(“./temp.html”, function(data){ $(“html”).append(data); } );
});
</script>
That’s it!
Save that, and refresh your admin index page.
What we have done here is essentially grab all the data that would be output by WordPress before GoDaddy’s get’s is greasy fingers on it, store that in a file.  Then we wait for the entire page to load, let GoDaddy do what they need to do, then wipe the page clean.  We then send out a request to get the non-abducted code and make that your page.  The ole switch-a-roo!
Of course, you probably stopped reading this after you saw that it worked and are now back here reading again to find out why none of the links work. 🙂
Well, we only changed the index.php page.  If you notice in your browser, you are probably now on post.php or edit.php.  This means that each file will need to have the above fix added to it.  I know, so much work, but totally worth it for about a half hour of work.
Caveat: GoDaddy’s puts those ads in there for a reason, so I’d advise to leave them on frontend of your site.  Yeah, I know, I hate them, but hey, a free account for a banner ad, not a bad price to pay.   I took them off my admin for one, because it broke it!, but two because, I’m the admin!!!  They don’t need to advertise to me, I already have an account with them.
-Happy coding!
Advertisements

23 Comments (+add yours?)

  1. Akshay
    Jul 23, 2010 @ 15:31:44

    Please upload your wp-admin/index.php I’m facing some problems…

  2. senica
    Jul 23, 2010 @ 16:59:43

    Hey, if you notice on the first line of this post, I did not get everything working. Several of the admin pages loaded fine after using the code I laid out above, but the products pages just went in some crazy loop.

    Also, one thing to check in your code, it seems like wordpress has lately been replacing single quotes and double quotes with some different characters that throw errors in php. So check those as well.

  3. Akshay
    Jul 23, 2010 @ 18:46:51

    I’m getting this error

    Parse error: syntax error, unexpected '>' in /home/content/i/a/m/iamtra/html/wp-admin/index.php on line 70
    

  4. senica
    Jul 23, 2010 @ 18:58:14

    hmm, email my index file. senica at allebrum.com I’ll take a look.

  5. Anonymous
    Jul 24, 2010 @ 00:11:22

    I’ve had the same issue. To fix it, you need to change the double and single quotes in the entire code that senica provided.

    When you copy and paste the code you’ll notice that quotes are italicized and are treated like any other character. Just delete it and replace with quotes on your keyboard.

  6. senica
    Jul 24, 2010 @ 00:29:18

    Hey, what is up with that by the way? Is wordpress doing that or is it just the particular theme I have? It’s really annoying. I used a function I had on my blog today and noticed that it messes up the single and double quotes.

  7. Natalie
    Jul 30, 2010 @ 21:47:33

    Hi, thanks for the article. I copied the script and put it into my index.php file, it comes up with parse error for this line of code

    $handle = fopen(“./temp.html”,’w+’);

    any thoughts?
    Thanks

  8. James
    Aug 03, 2010 @ 23:52:19

    @Natalie check the line before that with the “, it should actually be two ‘ instead of one “

  9. senica
    Aug 04, 2010 @ 17:30:52

    @Natalie, Also make sure you have write permissions so the script can create the temp.html file.

  10. Harry N
    Aug 19, 2010 @ 15:57:05

    Awesome post! Thanks for the remedy. Quick question, are we editing all the files in the admin folder?

  11. senica
    Aug 19, 2010 @ 20:25:25

    Hey Harry,
    I saw you comment this morning and went to reply to it. Must have got sidetracked. Sorry ’bout that.
    As you’ll notice at the top of the post, this is not a complete solution. I thought it was, until I started adding the fix to other pages and realized that some pages (like edit post) would not work. Was hoping someone would be able to figure it out and post the fix.

    But anyways, to answer your question, yeah, you’ll need to add the fix to any page that shows in your address bar. So for example, when you are viewing posts, I think it’s post.php. So you’ll need to add it to post.php. When viewing pages, it might be pages.php that wordpress uses, so you’ll have to add it to that. I imagine there’s probably 20 files that might need the fix added. Check them though as you do each one, to make sure it’s working. I’m sure you’ll run into a page that does not work..

    Oh, yeah, I think it was post.php that was having a problem. Basically it just kept refreshing when I added the fix to it.

  12. Elizabeth
    Nov 01, 2010 @ 20:18:10

    Hey, how did you fix the broken admin page…you said you removed the ads from the admin page because it broke it. How do you fix the admin page?
    Thanks!

  13. Alex
    Jan 12, 2011 @ 18:31:35

    You can also use admin.php for part 1 and admin-footer.php for part 2 of your instructions. So far that appears to make it work across all the pages I’ve tried. Still testing though… so I might stand corrected.

  14. Alex
    Jan 12, 2011 @ 19:05:40

    Nope – please disregard my post…. post-new still fails.

  15. beyondtool
    Jan 23, 2011 @ 10:56:16

    yeah this is only a half fix, the post and post new pages just reload and I get a white screen. Nice idea though.

  16. Trackback: Manually Installing WordPress on GoDaddy Free Linux Shared Hosting « ENTERPRISEYNESS
  17. Anonymous
    Sep 03, 2011 @ 18:16:52

    works for me on every page, but the fonts are not arial for the front page Dashboard. When clicking on Dashboard sometimes get a blank page, have to click on another link on the menu.

  18. Anonymous
    Sep 03, 2011 @ 18:19:02

    “Howdy, admin” gets written twice for the front page.

  19. Anonymous
    Sep 03, 2011 @ 19:02:49

    the temp.html created is missing the closing tag

  20. Anonymous
    Sep 03, 2011 @ 19:03:12

    missing the closing html tag

  21. senica
    Sep 04, 2011 @ 10:38:00

    The closing tag in the temp.html file SHOULD be missing. The browser needs a them html tag to be able to put data back to it, so on the browser side of things, everything is removed from the page EXCEPT the html tag. We remove it from the temp.html file so the html tag is not written to the browser twice. Keep in mind that this is not a complete solution, I haven’t tested it out in a long time, but I know there were some issues with it.

  22. web hosting web designing web development seo emailing
    May 17, 2012 @ 07:33:02

    I’ve been surfing online more than three hours these days, but I by no means found any attention-grabbing article like yours. It’s lovely value enough for me. Personally, if all website owners and bloggers made good content material as you probably did, the web will probably be much more useful than ever before.

  23. Marlin Kurtich
    Jun 13, 2012 @ 22:02:47

    It is really an excellent along with useful bit of information. I’m delighted that you choose to distributed this information here. Be sure to continue to be us advised similar to this. We appreciate you revealing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: