Replacing meta-value on database - wordpress

I need to migrate my wordpress site from local to online. I'm using custom post meta to upload files, so I need to change the string from "http://localhost/site" to "http://www.site.com/" but when I do it using some search and replace plugin, the value disapear. I think is because the new edit lock feature. How can I search and replace string on meta_value now ?

Try to use "WordPress Search and Replace Tool" - http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ This script allows to search/replace values even in serialized arrays.

Related

WordPress theme activation date

I was wondering if there is an activationdate stored somewhere. I searched for this in the database but cannot find it. I might make it through an option than but is there already something which I can use to determine on what date a theme ws activated?
Search your WordPress DB for theme_mods_ (in wp_options), there should be a timestamp (serialized) for each theme in there.

Serialized data in Wordpress form is "serialized" again when saved in mysql

I have a challenge with the way data is stored from Wordpress into mysql.
I'm new to Wordpress - but I'm trying to combine different plugins to achieve a specific functionality on a website.
Plugin #1 uses a specific type of post and some metadata - the plugin works great.
Plugin #2 can create posts of custom types and with custom metadata from the frontend. A flexible and great plugin.
My intention is to use plugin #2 to create posts from the frontend for plugin #1, which requires that some specific metadata contains specific values (otherwise the data are interpretted wrong). These values are saved with hidden inputfields in a form.
My challenge is that a value (which is serialized) is kind of serialized again. The value is a:1:{i:0;s:3:"198";}
Plugin #2 handles it well (as the data is shown correct in front- and backend of the plugin) - BUT in myPhpAdmin I can see that the data is saved differently s:20:"a:1:{i:0;s:3:"198";}"; - and hence that value cannot be understood by plugin #1.
I'm thinking of two options:
change something so s:xx: isn't added to the value(-s)
make the frontend form/plugin save the data in a serialized way so the value gets the correct format.
Any recommendations? - can I in anyway achieve my functionality?
Looks like
s:20:"a:1:{i:0;s:3:"198";}";
value is being serialized twice. You can check the plugin source code to see why the plugin serializing same value twice and if can prevent it than both plugin can share same data.

How to change the slug in Ghost to include only year and month?

In the latest release you have allowed us to add the date in the post slug. Is it possible to add only the year and the month? Even by editing the code? Because I'm trying to migrate from Wordpress I need it. In WP I use that format.
Note : I'm using Ghost 0.5
This is currently only possible to do in the database. You can change the value of the key permalinks in the settings table to read /:year/:month/:slug or run the following query on the database:
UPDATE settings SET value = '/:year/:month/:slug` WHERE key = 'permalinks'
In case you're using the default database (SQLite3) you can use a tool like SQLite Browser

Importing excel files into Wordpress custom post

I'm starting work on a new Jobs website (where client can create new jobs through the WP backend). This is easy enough with setting up with a custom plugin like post-meta
Wordpress - post meta plugin
Which I've setup with custom post meta fields (location, sector, status etc.)
However when I create jobs and fill out the post meta fields and check the DB they all have array encoding:
E.g. a:1:{i:1;a:1:{i:1;a:1:{i:0;s:11:"Sydney City";}}}
How do I remove this so it simply says 'Sydney City' for the meta key value?
But even if I fix that, the client needs to send me a spreadsheet with all the jobs, how do I import something like that into the DB? For example how can a spreadsheet like this:
Job Name,Advertiser,Status,Start,Finish,Category,Suburb,State
Value 1,Hays Constr,Tender,12/3/13,12/4/14,....
Be imported into the meta_key, meta_value architecture? Is it even possible?
What do you think would be the way to proceed? I do want the client to be able to edit Jobs in the WP Admin... but I also need to import a ton of jobs and surely there's a quicker way to do this

Wordpress admin suddenly not an admin

I have installed a template that I bought, and this template came with a SQL script to run. After I ran it everything works fine, except that the admin user now doesn't have permission to delete articles, media, and other stuff.
I have complete access to the server along with knowledge of PHP and SQL. How can I fix this?
Check the wp_user_level value in the wp_usermeta table of your database. It should probably be 10.
Found the solution.
The original WordPress installation used a prefix for all table names. Apparently, fields in wp_users, wp_options and wp_usermeta whose names begin with "wp_" are supposed to begin with the full prefix.
I changed the table names in the script, but not the actual field names.
Setting the names to the full prefix solved this.
example:
if the prefix is wp_f3refs then wp_user-settings should be wp_f3refs_user-settings.
Thanks everyone for your help.

Resources