I am trying to target all links with no www. in the database.
https://launchhousing.org.au
and replace with
https://www.launchhousing.org.au
I have used the 'search and replace' plugin which has apparently changed all of the links but somehow Visual Composer seems to still have links without the www. I am using the VC 'Icon Box' and added in the URL field: http://launchhousing.org.au/category/policy-agenda/
Visual Composer store links in urlencode format as:
link=\"url:http%3A%2F%2Fsite.com%2Findex.php%2Fmembership-account%2Fmembership-levels%2F|||\"
That's why you can't find.
You need make sql dump of your database and make replacing:
http%3A%2F%2Foldsite.com%2F → http%3A%2F%2Fnewsite.com%2F
I hope this helps. Good luck.
You mean links that are in the page/post content? These will be in the post_content of the wp_posts table, along with the rest of the content. All the VC elements you put into a page/post are just shortcodes.
Though I also have found that plugins, such as WP DB Migrate seem to miss VC stuff in the post_content column.
I always have to manually do an SQL query. You can do this in phpmyadmin:
UPDATE wp_posts SET post_content = REPLACE(post_content, 'launchhousing.org.au', 'www.launchhousing.org.au')
And remember to change 'wp_posts' if your prefix is different.
Related
I made a new website for someone but when i tried to launch it live i had problems with links. The old version of the site had language extension.
Now every link with the domain:
sites.com get extension ( ex: www.site.com/**es**/; wwww.site.com/**en**/,www.site.com/**es**/contact)
Even thow i made dynamic links i have problems accessing the wordpressadmin and also i have problems with referencing the homepage from other pages (only way i was able to to refence the homepage was by making something like site.com#).
After every change in wordpress admin the links are adjusted with language extension/string.
To remove all language extensions you could run a query in the form:
UPDATE wp_posts
SET post_content = REPLACE(post_content, 'site.com/es/', 'site.com/')
WHERE post_content LIKE '%site.com/es/%'
On your database for each language extension. This will remove all references in post content. You'll also want to check your wp_options table, replacing finds in the option_value field.
Finally run a check on the wp_postmeta table - many items will be serialised values and so can't be changed with a simple find/replace like above. Instead you should run a find, then figure out how to change any found values via the Wordpress admin panel.
As always back up your database before playing around.
I'm to get migrate a website I populated for a friend from my server to his. Unfortunatly, the migration process isn't working the way it normally should.
Does anyone have an idea to what would cause this wordpress site to break and for all the navigation to direct to the original site?
Even my wp admin redirects to orginal page
Here's the site I hosted it on for demo: http://www.designobvio.us/avproduktor/
Here's the site I'm trying to migrate it too http://avprodukter.com/
I have no idea why avprodukters isnt working: steps I took.
Exported database from designobvio.us/avproduktor
Replaced all links with designobvio.us to avproduktor
imported database to http://www.avprodukter.com/
installed wp and now i'm here
I'm going to repeat this process again to see maybe I was just dumb
Wordpress has some special steps you have to take when migrating it to a different domain. Namely, you have to change the Blog URL from the administrative interface prior to moving the site.
There is a reference in the database to the old domain and that is what it is using to build the URL's. Without starting over, you can use a tool like phpMyAdmin, or even the MySQL console to change that setting in the database.
The two settings you would have to change in the database are in the wp_options table (assuming tables are prefixed with wp_). The two option_names are siteurl and home. Both of those should contain the old domain; you need to update them to reflect the new URL.
See Moving Wordpress from the Wordpress Codex for the full directions and steps to take in different scenarios.
You could start over and follow the steps from the link above, or you can just change those 2 values in the database and then you should be set.
Replaced all links with designobvio.us to avproduktor...
How did you do that? In phpmyadmin? If by a text editor with a database dump, you broke some serialized data. Use the queries below.
UPDATE wp_options SET option_value = replace(option_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.olddomain.com/','http://www.newdomain.com/');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.olddomain.com/', 'http://www.newdomain.com/');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.olddomain.com/', 'http://www.newdomain.com/');
And did you reset permalinks?
See Moving WordPress « WordPress Codex and How to Move WordPress Blog to New Domain or Location » My Digital Life
I want to create more pages in wordpress via running a script. I am new in wordpress and did not understand the wordpress db structure properly. Where I put the page name, link, image and other details?
Can u please tell me the db structure of wordpress?
Thanks in advance
The complete wordpress database structure here
page,link,image all or must be in posts table.
You can find that in wp_posts table. You should find it in the database you create it to install the WP for the first time.
Everything you need to know is here:
https://codex.wordpress.org/Database_Description
It even has links to old versions.
depending on what you might want to add you may have to add things to wp_posts and wp_postmeta, and possibly the taxonomy tables.
Hoping someone can help.
I've inherited a WP based website which has WPMP already installed & activated & working on it (I can see it work on many pages).
I've had to create a custom template & a few pages that use this template. Unfortunately, when I switch to mobile mode (or check out the new pages on my iPhone), no posts show.
The custom template has to query for posts multiple times to display different groupings of posts in different places. I have a feeling these dynamic queries are removing the ability for WPMP to see any posts at all.
So the only thing I can think of doing is somehow "providing" WPMP the list of posts to see.
How do I do this?
Please help...
O8
I think that in your situation you best way will be to:
1. Upgrade wordpress to the lastest version.
2. Install http://wordpress.org/extend/plugins/wptouch/ - that will do all the work for you on mobile.
if you are having trouble fetch posts in mobile pack, then in custom temple, please run wp_query or SQL command to select all posts and declared a
Global $posts
and once $posts is populated then the regular commands which are used in the loop can be executed to show posts.
Are you using wp_reset_query after each loop?
http://codex.wordpress.org/Function_Reference/wp_reset_query
Use Firebug with Firefox, or Chrome's or Safari's or IE8's developer tools to see what's loading on your site and check for javascript errors and css conflicts.
I've got a Wordpress site on our home intranet that has run into trouble now that the IP address has changed - The index page loads, but not the CSS and I can't log in to the site administration panel.
Unfortunately I am a bit behind on backups. Is there a way to get Wordpress to refer to the new IP address?
You have two places to update this (well three, but we'll stick with the two).
If you can still log into your admin section, type the following for your URI /wp-admin/options.php - so for example, if your site is http://localhost then your full URL will be http://localhost/wp-admin/options.php. Once you've logged into your site you should see two fields (well you'll see a lot of fields), but you'll want to look for the two with URL's in them - the Site URL and the Blog URL (in WP 2.7 the fields are labeled "home" and "siteurl", not sure on the other versions).
Or, you can log into MySQL database and run the following.
Select * from wp_options where option_name IN('siteurl','home');
I just ran this today on one of my installs. If you're option_value is set to your localhost - you can then run the following:
update wp_options set option_value='http://www.yourblogname.com' where option_name = 'siteurl';
update wp_options set option_value='http://www.yourblogname.com' where option_name = 'home';
This should update your table structure.
You have to change the 'home' and 'siteurl' in the settings. Since you cannot open the admin side of wordpress, open the database in phpMyAdmin(or something similar).
The options can be found in the 'wp_options' table(wp_ prefix might be different). Find the necessary setting using this query...
SELECT * FROM `wp_options` WHERE `option_name` IN ('siteurl', 'home')
Change the values of both the options to the new IP.
To temporarily be able to login, use this code in your wp-config.php:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
or you can add this to your theme's functions.php:
update_option('siteurl','http://example.com/');
update_option('home','http://example.com/');
Warning: Updating the SQL database will be required in order for installed plugins to use the new URL/hostname. So if you use plugins modifying the database is required.
I ran into this problem before when I was migrating a site from test to production. Conveniently, MySQL has a string replace function.
Try something like this:
UPDATE wp_posts SET post_content = REPLACE(post_content,"http://localhost","http://www.myblog.com")
I ran into this problem once. Loginto your DB and check your wp_options (if wp_ is your table prefix) and then search for all records and replace your old ip with new.
Possible columns to have the old ip would be 'permalinks' etc.. Sorry I cant see my blog's table structure now otherwise I would have posted the correct column name.
Be careful for the link: https or http !!
in the command line:
mysql -u root -p
in the SQL, set new IP for xxxx
mysql> use wordpress;
mysql> select * from wp_options where option_id=1;
mysql> update wp_options set option_value="http://xxxx" where
option_id=1;
exit
Restart server
Possibly WordPress.org's coverage of this issue was not available at the time the other answers here were written, but as of now I find it more complete and easier to follow.
In my case, the method of modifying wp-config.php was only partially successful. The Relocate method described in the above web page ultimately succeeded.
Here is a synopsis of WordPress.org's coverage:
1 Changing the Site URL
1.1 Edit wp-config.php
1.2 Edit functions.php
1.3 Relocate method
1.3.1 Code function
1.3.2 Steps
1.4 Changing the URL directly in the database
2 Moving Sites
2.1 Altering Table Prefixes
2.2 Changing Template Files
2.3 Changing the Config file
2.4 Verify the Profile
2.5 Changing the .htaccess file
2.6 Additional items of note
2.6.1 Important GUID Note
2.7 Multi-site notes
2.8 wp-cli