(Partial Solution) WordPress “Press This” tool generates 404 errors

Wordpress Tips

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”.

In the “Location” line there will be a long javascript string. If you can’t see the whole string, you may have to select it all and paste it into a text file for editing then paste it back later. Once you can see that long javascript string, find this:

u='+e(l.href)+

and replace it with this:

u='+e(l.href.replace("http://",""))+

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.

The Error

When you drag the “Press This” bookmarklet to your bookmarks or favorites toolbar it creates a bookmark with a long string of javascript as the location. This bookmarklet is supposed to open the press-this.php file in your WordPress admin folder in a pop-up window with the URL you want to post in a quick press form along with the title of the URL you’re trying to post. Somehow it munges the URL you’re wanting to post and causes the 404 error.

“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

 

Comments

2 Responses to “(Partial Solution) WordPress “Press This” tool generates 404 errors”

  1. [...] (Partial Solution) WordPress “Press This” tool generates 404 errors [...]

  2. Jascha says:

    Good call on this worked for me!

Leave a Reply

feedbutton

Phone: 918-254-9730
Address:
125 S. Kalanchoe Ave.
Broken Arrow OK 74012

Follow Us on Twitter

Become a Fan -- Facebook

Latest News

[solution] WordPress Redirection Plugin Error

First it was just an error with my existing redirects, then the plugin redirected my front page. Luckily, there is a solution

WordPress Internal Permalinks by ID Shortcode

Tired of chasing down your internal links in WordPress? This shortcode is for you!

Solution: WordPress Upgrade and Image Upload Errors

If you’ve ever had an “incompatible archive” or “saving media attachment” error when working with WordPress, the answer may be simpler than you think.