Throughout transforming your blog from Blogger to Wordpress and managing a script to seize hot-linked images for hosting, I wound up with a few funky images names like

act%252Bapandas-210x290.png

These image names avoid the image from exhibiting on the web page, due the url encoding winding up within the file title itself (don't request!). I re-named them around the file server, no prob, however the names will also be within the attachment metadata for every publish.

How do i take away the "%" all the look references within the wp_postmeta table? Many of them exist in serialized arrays in meta_values for that meta_keyof _wp_attachment_metadata. I have didn't have luck getting a wordpress plugin, and am unsure how you can institute a pure SQL solution.

EDIT:

Because the bloggers have stated, the problem is altering or getting rid of the "%" character AND upgrading the array therefore it reviews the right quantity of figures (ie the s:13 would indicate yoursite.com is 13 char[]) I am also available to utilizing a php solution! Whatever might help me fix this mess.

AFTERNOTE AND SOLUTION

I did not really frame this when it comes to WordPress problem, I presented it as being a SQL problem. I granted my answer accordingly. However I could solve the issue natively (with the aid of Rarst @.This is how I reduced the problem, using native WordPress functions within the loop:

$posts = get_posts(array(
    'post_type' => 'attachment',
    'numberposts' => -1, ));

foreach( $posts as $post ) {

    // retrieve data, unserialized automatically
    $meta = get_post_meta($post->ID,'_wp_attachment_metadata', true);

    // loop through array to do any search and replaces

    // write it back
    update_post_meta($post->ID, '_wp_attachment_metadata', $meta); }

These characteristics will instantly determine kind of data you're locating or writing and (not)serialize it if required. This really is handled by internal utilization of maybe_serialize() and perhaps_unserialize() functions.

I am sure it's not possible related to pure SQL because of complexity of serialized array structure.

Do this query: (replace the Area_NAMES together with your area names entering them in separate queries)

update wp_postmeta set FIELD_NAME = replace(FIELD_NAME, '%', '');

NOTE: You are able to alter the '' and turn it into a space or anything you want (departing it as being it replaces % without any space and little else).

EDIT: Nevermind, browse the bigger comment by Stephen Chung.

If you want to eliminate %'s, it's easy -- just replace '%' with another thing using the REPLACE function.

However, I suspect you wouldn't want this. It's not obvious inside your question, however i suspect that you will want to decode that %xxx to the right character too. Within this situation, you are able to first extract the "xxx" area of the string (that ought to maintain hex) attach "0x" before it and cast it to several, then convert time into string. After this you use SUBSTRING to stitch back your text data, using the "%" removed and also the new string replaced in-place.

EDIT: Don't Do That: This Might BREAK THE SERIALIZED ARRAY (SEE COMMENT BELOW)

I am keeping this (incorrect) answer so that individuals knows its issues.

To eliminate the % signs inside a column, you need to have the ability to make a move like:

UPDATE table_name
SET field_name = replace(field_name, '[%]', '')

This is how I reduced the problem, using native WordPress functions within the loop:

$posts = get_posts(array(
    'post_type' => 'attachment',
    'numberposts' => -1, ));

foreach( $posts as $post ) {

    // retrieve data, unserialized automatically
    $meta = get_post_meta($post->ID,'_wp_attachment_metadata', true);

    // loop through array to do any search and replaces

    // write it back
    update_post_meta($post->ID, '_wp_attachment_metadata', $meta); }