Im migrating a wordpress site for the first time. I can get the site to load here: http://www.foureyescomic.com/ by updating the config file and the database table like this:
But now I'm getting images with broken links like this:
You need to update wp_posts table in database. Here is a workaround.
If you the original address is up yet, it is more convenient to use a plugin for migration. Here is a good one.
Yep, that happens because the absolute URLs of the images are stored as text within your posts' content in the wp_posts table. If your site's backend is functioning, you can use a database find/replace plugin to find the old urls in that table and replace them with the new urls. Or you can just do it with SQL/phpMyadmin if you're comfortable with that.
I find the easiest is by using this plugin: Better Search & Replace
It's pretty straightforward from there:
Install and activate the plugin, then in wp-admin go to Tools > Better Search Replace.
In the Search For field, put your old url. Ex: http://www.oldurl.com
Then in Replace With put your new url. Ex: http://www.newurl.com
In the Select tables section select wp_posts (or whatever your posts table is if you use a differnet prefix)
You can leave Run as dry run? checked if you want to do a dry run first to see what'll be changed. If it's unchecked, the changes will be made in your database.
Hit the Search/Replace button and that should do it!
Make sure you're using the exact strings you want to find and replace, and think about whether the search string could potentially occur anywhere else in that table where you wouldn't want it to change, otherwise you could screw things up. You should definitely have your DB backed up before you run this.
Hope that helps.
Related
I am looking for a way to mass edit my entire wordpress site. I have 25000 pages with rel="noFollow", and I need to delete that from every page. I am doubtful, but is there a way to automate this process, or am I stuck removing the "nofollow" tags one at a time?
An easy solution is to dump your database. Then in a text editor like Sublime Text you can do a search and replace. Then reupload your db.
It will depend in what you want to replace a link in the theme or content in the database.
Before you do any changes to the database, remember to create a backup. Also, consider setting up a development site to perform any test. That way you can test as many plugins as you can without fear of messing up your website.
To do what you want, Better Search Replace can help you replace text in the database. You just need to use the HTML code you want to replace. In your case rel="nofollow" with a blank field.
My issue is that the styling that was done to the website is completely missing. The Widgets are also not showing up. When I go into the backend, they are all in place. IF I add a NEW widget, it does show up. So I have something wrong in the .sql file is my guess.
I did notice in my database that I still have a file structure like this: /home/cyndeetg/public_html/mywebsite.com/wp.......
I've seen how on other tutorials to remove the "cyndeetg" part. it's easy to figure out on there, but the way 1and1 does it, it's not clear to me how to find out the new name. The database on the other ones was something like cyndeetg_213 and all you had to do was replace cyndeetg with the new database name in your database, but 1and1.com database names are made completely different and are something like dbw12ed1d214 (no underscore). I think this is what I need to fix but am still not sure. Any thoughts?.
Original Div site
New live site
I did another dump and restore since I learned that the way Wordpress codes where the data is for the plugins data is strange. I used a simple find and replace app called "Velvet Blues Update URLs" just to update the links and the locations of images/documents and all is working perfectly. I hope this helps someone else if they come across this!
I'm just trying to move one of my old php sites to wordpress. As part of the site I have 'top tables' e.g. top 10 cars, listing their features etc. At the moment that all comes from a database and the HTML is generated from the data.
So if a car soon gets a hybrid engine I just check that in the database and my web site table updates to reflect that.
This all works fine. I just don't know where to start when trying to implement something like this in wordpress. I want to keep the WP header, footer, nav... and put my table in to the content area.
Someone recommended simply copying the current generated HTML in to a new post and editing the HTML when anything changes, this sounds like a quick solution but there must be a better way of doing this.
Ideally I would want to keep my current data input pages (and separate database) for all of this 'table data' and present the out put as a post.
If anyone can point me in the right direction (key words I should search for, a guide) that would be great.
Depending on your usecase, you'll usually want to use a static page template:
http://codex.wordpress.org/Page_Templates
Or shortcodes:
http://codex.wordpress.org/Shortcode_API
Before making a CSS change that might possibly have unintended consequences, what's a good way to find where else on the whole site (not just this page) that id or class is used? (It doesn't have to be exhaustive, and semi-manual processes are ok, too.)
For a bit of context, it's a Joomla-based site with a lot of content, and I'm not yet familiar with most of it. The id in question has a two letter name, and I have no idea where else it might be used. I don't have direct access to the server for any grep-like approaches.
The only technique I can think of is using Stylish to make an obvious change to that one selector, and browsing the site for a bit to see where it pops up.
The easiest way would be a local grep, but since you don't have access to the server, try downloading it locally using wget:
wget -r -l --domains=http://yourdomain.com http://yourdomain.com
That'll recursively retrieve pages from your domain to an infinite depth, but only following links to pages within your domain.
Once it's on disk, do a local grep and you're golden.
I use unused-css.com for this sort of thing. You simply put in your webpage, and it will look through the whole site (incl. login) and give you the CSS that you actually are using.
I've found it to be 95% correct - but it only doesn't pick up on things like some CSS browser hacks and some errors (ie. the CSS only displays after an error), so it should work fine for this.
You could also check the original template (assuming the template is a commercial one) to see where the id perhaps should be (they usually lay everything out in their demo template), but unused-css won't tell you exactly where it is used, only if it is or not. For that, I'd start with a view-source -> find on the major pages, and then try other mentioned solutions.
Get the whole site's source tree into an IDE like NetBeans or Eclipse and then do a recursive search for id="theid" on the root folder.
If this is not possible, how are you updating the CSS?
Assuming you don't want to do the grep approach:
Is the ID in question appearing in the actual content area of the page, or in the 'surrounding' areas? If it seems like it's not part of the content, but rather appears in a template, you could search the template files for it. As you're updating the CSS, I'm going to assume you can at least get a hold of the template files. Many text editors/IDE's will let you do a 'global search'. I'd load the template files in TextMate (my texteditor of choice) and do a "search in project" for the particular ID.
That will at least give you a semblance of an idea of where in the site that ID shows up. No, it won't be every 'page', but you'll know what kind of page it appears on (which, with a CMS, is really what you're after).
If the ID in question appears in the content, that is, it was hand-entered by content creators, you'll have to go another route. Do you have access to the database? If you can get a dump of the database (I think Joomla! is MySQL based), you can open the sql in something like Sequel Pro and do a search in the content records for that ID.
This is not actually as hard as it sounds. First place to look the index.php file for the template. This file should be pretty small without a ton of code unless the template is from a developer that uses a template framework. If the ID is in there, then it will show up on every page in the website since this is the foundation that every page is built on.
If you don't find it in there, then you need to determine whether it is displaying in a module position or in the component area. You should be able to tell the difference by looking at the index.php file from the template.
If it's in a module position, then the ID should only show up in instances of that particular module.
If it's in the component area, then it should only display in any pages being created by the component. That does leave the possibility of it affecting many elements you don't want changed. But there is a solution for that. you can use the page class suffix in a menu item to add a unique id/class to the page you want to change (depends on your template). With that unique suffix you can create a specific selector that will only affect the pages you want to change.
We are using the NextGen Gallery plugin to generate a slideshow in a Wordpress site. I needed to change the site URL to a a different subdomain, and this seems to have broken the links. The plugin-generated javascript still passes the old URL to swfobject.embedSWF.
Does anyone know how to fix this? I already updated the Wordpress "General Settings" with the new WordPress address and Site address (which are the same), and the plugin does not seem to pick up that change. Thanks!
Found it. It's in the string-encoded ngg_options entry in the wp_options table. The specific field is "irURL".
Why they chose to capture the site URL independently, instead of reading it from the Wordpress site configuration, is beyond me.
Could it be that NextGen has hardcoded those values somewhere in its database tables?
It could be a matter of running a bunch of SQL update queries to replace any instances of http://old.domain for http://new.domain
And now I'll state the obvious, recommending you to backup the full DB before you attempt any of this.
I had the same problem (unchanged absolute CSS/JS files' paths) after domain changing although I changed every single old domain's occurrence in database (even in serialized arrays/objects in options).
I found solution on http://www.nextgen-gallery.com/galleries-opening-lightbox/ - I didn't have time to do an investigation where they store these paths or in which format. :P
For me it is extremely stupid in Wordpress that it stores absolute paths (with one and the same domain) in so many places but that's another matter. :)