Wordpress setup: wp-config and content transfer - wordpress

Can I delete the wp-config-sample.php after I save it as wp-config.php?
Also, is there a way I can transfer all my content from my old web pages which are not in a database to Wordpress, instead of manually adding all the content page by page? Keep in mind that I'm adding Wordpress to my GoDaddy hosting account.

Yes you can delete the sample configuration file if you want to.
You could theoretically write a script to take the content from your pages and insert them into Wordpress, but depending on the number of pages and the diversity of the structure/content of the pages it may be more worthwhile to do it manually.

Yes you can delete the file. There is no harm in it as the file name says its just a sample file.
Well copying the content from your old web pages is a tiring job. And as Ghills said its not an easy task to write a script to move the content as there are lot of other jobs involved when you write a post. Example : Categories, Tags, images etc.
Also you cannot trust the script completely as you will be moving a HTML content and dont know how wordpress editor will accept it.
Its better to o it manually.

Of course you can delete the file, because it is a sample. Most people rename it to just wp-config.php and modify it, but if you went through the graphical interface, there is no harm.
As for transferring, since you are making a static-to-live transfer, it is recommended to do this by hand so you will not make any errors with a script.
Although this is a hassle, the next time you need to move it, there are scripts as well as setups for a WordPress-to-WordPress transfer, WordPress-to-Typepad transfer, etc.

Related

WordPress restore the whole website only with ftp

so this might be a long shot, but I have a copy of the whole ftp directory of my old wordpress site and I would like to restore it as it used to be. However, before getting rid of the hosting and everything, I forgot to backup the original database, so now I'm only left with ftp directory, but the wordpress stores its content and pages in the database. So I was just wondering if somehow I could get lucky and restore all the content and database with only the ftp files. I highly doubt myself that such an approach would be possible, however I am no pro with wordpress so maybe there's something I could still do. (The original database is gone forever). Thanks.
Unfortunately not... unless you happen to be exceedingly lucky and have a backup plugin's cache in your wp-content folder and there's a .sql or .sql.zip file there by some miracle!
You can get some view of the web by using this link http://www.cachedpages.com/
And you can work on those text content displayed also you already have the image in the wp-content folder and you can rebuild the site with minimal time frame considering starting from the scratch

IT is possible to call http images from wordpress site to my ssl site

I want to dispaly post of non ssl wordpress site to my ssl site but while displaying images it gives mix content warning in console.
How to solve it pls help.
Solution 1 :
This is the simplest fix. If an asset (image, script, etc.) is hard-coded into a plugin or theme, change it from http://example.com/assets/logo.png to https://example.com/assets/logo.png.
Typically, this is most useful when including assets from other servers, like Google scripts, API scripts, or iframes.
Before doing this, however, you need to make sure the HTTPS version is available. If loading an asset from a site that doesn't have HTTPS enabled, it's probably best to remove the reference entirely (i.e. comment out or delete) or to save the asset to your own server and change the source to load via your site instead.
Solution 2:
References to your images are stored in your database, both in the wp_posts and wp_postmeta tables (in a standard install. You might have given your tables a prefix, but locating them should in any case be doable).
Since you mentioned using phpMyAdmin I guessed you are able editing the contents of your database with this tool.
Via phpMyAdmin you could manually locate and change the urls pointing to your images (removing the 'wp' part). But as this might be quite a few database entries, replacing all in one go is a more convenient decision.
I myself have had satisfactory results by
exporting the complete database as a .sql file through the phpMyAdmin export option.
editing this file with a text editor (converting the incorrect urls to the correct ones, make a backup copy first in case anything goes wrong, never forget the backup!)
deleting all database tables (for the wp install you're trying to correct)
importing the edited .sql file

Adding plugins that required database changes to version control on Wordpress

I'd like to add a installation of a Wordpress site to version control. After researching a little bit, I found some files/folders that should be ignore, like sitemap.xml and cache folders.
Every single one of them say I shouldn't ignore wp-content/plugins/, which is a reasonable advice at first. The question is: How should I deal with plugins that alter the database?
I can see two scenarios:
If the plugin has to add some tables on installation, this trigger would be lost since it would already be "installed" after uploading the files to the server.
If I must access the installation screen on production, then there's no reason to version control these files.
I would suggest to take a look at this great presentation. It's the most complete I saw yet.
http://stevegrunwell.github.io/wordpress-git
You should have your plugins directory in there too since you do want to track plugin files. As for the database, that's another subject completely. Take a look at the development of VersionPress, it should be out at the end of the year.

Use Wordpress for static WebSite

I want to create a static website and use wordpress only to "compose" the website. I want to create a template that only use the same header and footer and change the content of the page (home, contact ecc dcc). My site is not a blog or any other type of site that needs CMS I only want to use Wordpress to have only one header and footer and don' t want to change it in all pages when I need some customization to it. I hope I was clear enough! Thanks!
You can create a site in WordPress (or any other CMS) on your own local computer, then save a copy using an offline browser such as HTTrack. Then upload the HTTrack saved HTML to your webhost.
This will make your site faster, as there will be no need to execute PHP on page requests, and the webserver will use its default caching headers. (Also, you get the option of using a cheaper hosting without support for PHP and MySQL.)
Any time you change the site, you'll need to edit the live WordPress version, save it again, and reupload the files.
Disclaimer: I'm dev of the WP Static HTML Output project.
It's been around for a few years and still has 5k+ active installs, but jazzing it up with some more features now and its whole purpose is to allow you to use WordPress for your site development and export to a static HTML version for speed, security and portability.
For the OP, the basic FTP publishing option may be of use. For more advanced cases, there are services like Netlify which can auto build/deploy your static site from a Git branch.
In the Settings | Reading admin page, choose a static page for your front page display. Build your site out using Pages instead of Posts. Each Page will inherit your site's standard header and footer. Create your Main Menu from the Appearance | Menu admin page to hook together your Pages. Use widgets and standard HTML links as needed. Then dress up your site with one of the many available themes.
A bit late to the table on this one but it seems that Wordpress is totally overkill for a static site. Wordpress pages can be cached with cache plugins but when any Wordpress site loads there are a number of scripts and custom php functions that run each time a page loads.
Why not just build a flat file website and simply include your header and footer with PHP? Far quicker to set up and based on your question it seems that this is simply what you need.
Added to this, you won't have an admin area for your site or a database, just the files on the server - surely this makes your site less hackable too. An added bonus is a really easy site to version control with Git or SVN.
If there's someone else out there wanting to use a static site generator over Wordpress, here's a script called WP Static which does just this: http://mossiso.com/code/make-wordpress-static
Another great solution to this problem is to use a specific software that is created exactly to do that. For Mac, for example, there's a software called Hammer that "compile" your site every time you save and includes your header and footer to the page. Is really useful.

Two domains on same WP site, but different header

I'm using Wordpress for a client's website and this client asked me if he could have two domains with the same content, but a different logo on top of the page. So for example:
www.website1.com with logo1
www.website2.com with logo2
Both with same theme & contents.
I was thinking of a double WP install, but then you have to do every change two times. I read something about multisites in Wordpress, but could not find out how to do this.
I hope someone can help me out, thanks!
On the SEO front this is a bad idea, you will duplicate all content Google won't know what to value more. But if you really want it.
you could do this with two wp install's but there are problems.
First set your site url's in the wp-config
Second let both installs connect to the same database. The change in
header can be detected with $_REQUEST (google it)
Now there are 2 problems left which I don't know how to fix.
The uploads folder need to be synchronized so each site can access the uploads
the solution will be with simlinks stuff. (which I'm not familiar with)
And your hosting provider has to allow it.
If you add an internal link in your post/pages it will prepend the complete site url, and save this hard coded in the database.
The solution of this could be in the editor, of to filter the content before it is printed.
If you want to go this way I'm willing to look further into these problems
Here is a relatively recent article on how to set a multisite wordpress network up.

Resources