Skip to main content
12 events
when toggle format what by license comment
Apr 25, 2013 at 13:29 comment added tfrommen What? I thought, you had already done what you wanted!? Your comment made me think this. No, you do not have to put it in a function, and you especially do not have to put it in wp-includes/functions.php, but in the functions.php file in your theme's directory. Please edit your question and explain what you want to do now, why you want to do this (again?) and what your problem is.
Apr 25, 2013 at 13:23 comment added user31445 Btw I don't want to use database way but I want to use wordpress way
Apr 25, 2013 at 13:17 comment added user31445 Do I have to put function name on the top of global $wpdb; ? and what is the name for the function? any name? and also this new function going to wp-includes/functions.php right?
Apr 13, 2013 at 12:51 comment added tfrommen @user31445 If your question has been solved, please accept the particular answer (by clicking the check mark below the vote count) to let others know it has been solved, as well as to prevent your (seemingly unsolved) question from being pulled by the community bot.
Apr 13, 2013 at 12:30 history edited tfrommen CC BY-SA 3.0
Added other version
Apr 13, 2013 at 12:28 comment added tfrommen @birgire Of course, that's right. I'll add that to my answer. I just thought, you'd normally know your table prefix (or if not, you most likely did not change it, so it's wp_), and thus wp_posts is slightly faster than {$wpdb->posts}. ;)
Apr 13, 2013 at 12:24 comment added birgire You can use "UPDATE {$wpdb->posts} SET post_content = ..." or "UPDATE {$wpdb->prefix}posts SET post_content = ..." .
Apr 13, 2013 at 12:05 comment added tfrommen You just have to set <YOUR_PREFIX_HERE> to your WP table prefix. Normally, this is wp, however, you may have changed that to something else. You can see this either in your database (all WP tables have the same prefix), or in your wp-config.php file.
Apr 13, 2013 at 12:04 comment added user31445 I put the sql query but I've got this error #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<YOUR_PREFIX_HERE>_posts SET post_content = replace(post_content, 'www.lol.com/?' at line 1
Apr 13, 2013 at 12:02 comment added user31445 Do I have to fill up UPDATE <YOUR_PREFIX_HERE>? and what is it?
Apr 13, 2013 at 11:22 history edited tfrommen CC BY-SA 3.0
added 260 characters in body
Apr 13, 2013 at 11:08 history answered tfrommen CC BY-SA 3.0