Tag Info

Hot answers tagged

4

The string below actually represents an array in serialized form. a:1:{s:13:"administrator";s:1:"1";} Here: a:1 means an array with a single element s:13 means string and the length of the string followed by Array { "administrator" => "1" } Once that is in the table, you can use the unserialize() function to return it to an array for use in ...


3

Here is a picture explaning how to do it be carful and backup the database befoure any changes are done first here is a link to md5 encoder (youll need it): MD5 Encoder . Hope this helps ;) Cheers, Sagive.


3

What you posted will work fine for all links that are generated by WordPress: permalinks, script/style enqueues for local files, featured images, etc. I tend to define my Site URL and Home URL dynamically like this: <?php define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); define('WP_SITEURL', WP_HOME . '/wp'); Note: HTTP_HOST isn't always present, ...


3

The easiest way would be to look at the code of Si Contact Form (since it already does what you want) and use the same kind of system. Shortly, you'll need methods to do the following: Create an XML (or other format) document of your theme options. Save/Export the XML document. Import the XML document (There's no point in exporting if you can't import it ...


3

You are trying to access the install via a file url: file://home/cnorton/scratch/install.php.html That is not going to work. That bypasses the web server and you need the webserver to process the request and pass things to PHP, which then passes the generated page back to the server for delivery to the client (your browser). You need to access the file ...


2

This piece of mySQL code should do the trick. Go into PHPmyAdmin, click the SQL tab and paste this code: UPDATE wp_posts SET menu_order = 0 WHERE post_type = 'my_post_type'; This should set menu_order for all posts of the post type of your choice to 0.


2

If your database is set up to deny remote connections (i.e. only applications on the same server can interact with the database) then there's no danger in giving your WordPress user full access. As a matter of fact, most automated installation scripts used by web hosts grant full access to their WordPress user by default. Keep in mind that your database ...


2

Ok, sorry for asking. I figured it out. But for future people, here's a suggestion. Step 1 (BACKUP!!!!) - backup your database, if the next step screws you over and you don't have a backup it's your own fault. Step 2 - Use PHPMyAdmin or similar tool to access your DB, find the wp_usermeta table and then sort by user_id. User #1 is your admin. Next find ...


2

The database user name/password is not stored in the database; it is only used to access the database. Change the username (and password, too) to the new values in wp-config.php. And the problem might be access to the database via phpmyadmin; check your username/password in Cpanel or some other hosting control panel.


2

I would do this so. But this is probably not the most efficient way accomplishing this task. There are several plugins out there, that may automate this. If anyone knows one, that is good, I would like to hear about it. Plugins that look promising: http://wordpress.org/extend/plugins/xcloner-backup-and-restore/ ...


2

You need to change the file permissions on your wp-content folder (and containing folders) to 755. On your setup you can do this with: sudo chmod -R 755 wp-content


2

Ok, based on that, I'm almost positive that you need to re-enable permalinks for your site. You are probably missing your .htaccess file or it is missing WordPress's rewrite rules. Go to your admin and find Settings > Permalinks. Select an option, and click "Save Changes" twice (there is a quirk that this avoids). This will have WordPress automatically ...


2

Drop this into a file in your plugin directory and you should be able to do this from your WP installation using a query string. /* Plugin Name: Delete Specific Post Description: Rid the post forever! Version: 0.1 Author: WPSE License: GPL2 */ add_filter('query_vars', 'delete_post_query_var'); function delete_post_query_var($vars){ $vars[] = ...


1

You actually want to look in the wp_usermeta table. Once in there, look for the entry that has 'wp_user_level' in it's 'meta_key' column and has the matching 'user_id' that you would like to update. Then change that 'meta_value' to 9 or 10. EDIT: updated link to current documentation: http://codex.wordpress.org/Roles_and_Capabilities#User_Levels


1

I had the same problem and all these solutions didn't help me. The one who eventually worked for me was: Log in to your PHP Admin to edit the database Find the table wp_usermeta and see what the ID is of the admin (probably 1) Now find the wp_capabilities field Replace the line with the following line: ...


1

You do not want a simple SQL solution. post_name is used to generate permalinks. If you simply copy the title to the name (slug) you will have spaces and punctuation in the URL, and that is going to be a problem. It will result in broken links. Additionally, you could end up with two posts having the same permalink which will result in unpredictable ...


1

DISCLAIMER : Not a WordPress Developer, Just a MySQL DBA If you have privileges to login to MySQL and query data you could collect all the comment_ID values that have one word. SELECT comment_ID FROM wp_comments WHERE REPLACE(TRIM(comment_content),' ','')=TRIM(comment_content); You can test this by also seeing the comment_content SELECT ...


1

This seemed to work for me (although, to be honest I wasn't too attached to my local database, so if I lost it...) From "online" version Go to phpMyAdmin Export SQL (Structure and data) Then: On "local" computer version Write down the name of the database Drop the database. Open the SQL file you exported. Do a find and replace: ...


1

Try using a web-based MD5 generator, and then paste the generated MD5 value directly into phpMyAdmin without using phpMyAdmin's MD5 function. When using the generator, choose a simple password, like "temp123" to avoid any potential issues with complexity. Then once you can login to WordPress, use the Admin Panel to change ithe password back to something ...


1

Plugins and themes are no in the database, they are physical files under wp-content directory, and that is why you CAN'T find them in the database nor edit them from phpmyadmin. However WordPress has a built in editor for plugins and themes files. For themes its under appearances -> editor and for plugins its under plugins-> editor.


1

OK So I worked this out. This query will do the trick of moving the pages: INSERT INTO wp_xxx_posts SELECT * FROM wp_posts WHERE post_parent IN (123,456,789,1011); The xxx relates to the destination MultiSite ID (wp_3_posts for example). The (numbers) in brackets are the parent ID's ('post_parent' in the WP table) of the pages I wanted to import. ...


1

menu_order is one of the columns in the *_posts table. In my dev database it only seems to be used for the nav_menu_item post type, but I haven't looked into it very carefully. I am not sure about the connection to your categories. When I add a category, it is added to the menu as a nav_menu_item. Presumably that is how things work on your site too, unless ...


1

Mysql allows you to run queries that apply to all post, see example : UPDATE wp_posts SET POST_CONTENT = replace(POST_CONTENT, '<a href="http://mysite.com/my_link">mylink</a>', ''); This code allows you to delete <a href="http://mysite.com/my_link">mylink</a>on all posts. But in your case I doubt all links are the same so you need ...


1

Here you go (you're really close): INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID AS post_id, 'customer_reviews' AS meta_key, 'On_or_delete' AS meta_value FROM wp_posts WHERE wp_posts.post_content LIKE '%Customer Reviews%' AND wp_posts.post_type = 'post'; ` Edit: You could also just change IS IN to IN. I rewrote the from part of ...


1

Since you want to test out your existing(local) site on the server; you have done the right thing as far as I can see on pastebin except for 1 thing On step 10 - you replaced all occurances of "localhost" with your servername. Instead you should have replaced it with servername/directoryName. If you still have issues, please let me know the exact issue you ...


1

WordPress does not log anything natively. Closest it has to such functionality are just post revisions and ability to enable logging of PHP errors. There are plugins around to log events, but since you hadn't one installed in advance it won't help you retroactively. If you think it was from action by logged in user you might get some information from web ...


1

The Formidable Form plugin seems to ignore database errors in many places in the code. Setting WP_DEBUG to true uncovered that the forms are not created because some tables are missing (no indication is given to the user). Further investigation has shown that the tables fail to create when the plugin is activated (no indication is given to the user). The ...


1

This feels like it is too link-heavy for an answer, but oh well. You can either use the Velvet Blues Update URLs plugin or the Serialized Search and Replace script. Either will allow you to search for a string in the database and change it to something else. The former lets you do it from your dashboard, whereas the latter requires you to FTP the file to ...


1

Here is what you need. <?php $date = new DateTime('NOW'); $date->sub(new DateInterval('P30D')); //30 Days Interval echo $back30days= $date->format('Y-m-d H:i:s') . "\n"; global $wpdp; $top_users = $wpdb->get_results("select count(users.user_nicename) as posts, users.user_nicename as user_name from $wpdb->users as users ...


1

Don't try to do this with SQL. There is post information is multiple tables. You will end up with orphan data scattered throughout the database. While it is possible to write the JOINs you'd need to delete everything, the SQL could be complex. Create a simple Loop and use the Core to delete your posts. $args = array( 'post_type' => 'post', ...



Only top voted, non community-wiki answers of a minimum length are eligible