If you enjoy the Facebook bookmarklet for adding a quick post to Facebook, you’ve probably used the “Press This” tool from WordPress, or tried to. When it works right, it opens a pop-up window containing a quick post form. There’s a bug in this bookmarklet, however, that makes it sometimes generate a 404 error.
Reading the forums, this seems to come and go maybe on a version basis, so its not a very reliable tool. There are plenty of fixes around, but none of them worked for me. So I hacked a partial solution.
Modifying the “Press This” Bookmarklet
The fix is pretty simple. Create your “Press This” bookmark by dragging the link from the Tools > Tools page in WordPress to the bookmark or favorites toolbar in your browser. After you’ve created your bookmark, click it and see if it works. It should open a pop-up with the title of the page you had open when you clicked it as the post title and a link to the URL with its title as the link text. If you’re not logged into WordPress, it will ask you to log in first.
If you instead get a 404 error in the pop-up, close the pop-up, then right-click the bookmark and select “Properties”.
and replace it with this:
My code modification only fixes the bookmarklet for URLs that start with http:// so I call it a partial fix. URLs that start with https:// still cause the error.
I’m not so sure this is a drastic error because most https:// (encrypted) pages are behind a password and probably aren’t good candidates for posting anyway.
“Press This” can be valuable. You don’t have to keep a WordPress window open while you’re working on other things. Just click the bookmarklet and you get a quick press form in no time flat.
If “Press This” is something you’d like to use, but couldn’t, this hack works for URLs that start with http:// so I guess it’s a start