Results 1 to 4 of 4
  1. #1
    Full Member gcarson's Avatar
    Join Date
    November 13th, 2009
    Posts
    383
    Wordpress / myql Question
    I've tried for a while to figure out this easy solution but I can't seem to figure it out. Its pretty basic so don't laugh. I tried asking a few people who know mysql but apparently I asked the question so incorrectly that they couldn't help as they thought it was a wordpress and not mysql question.

    Basically, I was using a plugin that I decided to uninstall. Instead, I just hacked the code to do the same thing (and saved myself over 500ms in database time / page load!). But now, I may use the plugin for another reason (this time not so resource intensive). The plugin saved a custom field that I still use, lets call the custom field altimage. Because I'm planning on reusing the plugin, I can't use that specific custom field both ways. So I wanted to go in and change all instances of altimage to say newaltimage. I know in the database its saved as a meta_key in the wp_postmeta table.

    So can anyone help with the line of code that will allow me to change the value altimage to newaltimage in the field 'meta_key' in the 'wp_postmeta' table?

    I'm not 100% sure I'm using the right terminology but I hope something gets it?

  2. #2
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    I am not sure I am understanding you right but if you go can go into phpMyAdmin and do the SQL query:

    UPDATE wp_postmeta SET meta_key = 'newaltimage' where meta_key = 'altimage'

    that will update all instances of altimage in the meta_key field in the wp_postmeta table to newaltimage.


    If this isn't what you were looking for, please let me know.

  3. #3
    Full Member gcarson's Avatar
    Join Date
    November 13th, 2009
    Posts
    383
    Thumbs up
    Quote Originally Posted by bettylou View Post
    I am not sure I am understanding you right but if you go can go into phpMyAdmin and do the SQL query:

    UPDATE wp_postmeta SET meta_key = 'newaltimage' where meta_key = 'altimage'

    that will update all instances of altimage in the meta_key field in the wp_postmeta table to newaltimage.


    If this isn't what you were looking for, please let me know.
    This is exactly what I needed. for the life of me I couldn't find what I needed. All the googling I did took me to some site that wasn't very helpful. I really appreciate it!

  4. #4
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    No Problem!

  5. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. WordPRess question
    By pryidevsblog in forum Blogging, Mobile and Social Media
    Replies: 7
    Last Post: January 24th, 2015, 10:07 AM
  2. wordpress theme question
    By breakingtheborders in forum Blogging, Mobile and Social Media
    Replies: 16
    Last Post: October 29th, 2011, 02:55 PM
  3. WordPress question
    By Heidi in forum Blogging, Mobile and Social Media
    Replies: 5
    Last Post: May 1st, 2010, 10:49 PM
  4. Simple Question About Wordpress
    By ryanm123 in forum GoldenCAN
    Replies: 3
    Last Post: April 2nd, 2009, 08:13 AM
  5. Wordpress Plugin Question
    By SkinnyMoose in forum BounceLinks.com
    Replies: 3
    Last Post: August 4th, 2008, 05:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •