I have this weird problem with my Wordpress Website. I worked on localhost and afterwards I tied to get my site online but i modified some configuration files and i don't know witch one is the fault. I am using XAMPP. The website right now is seems to not load js and css. Also on console log it gives 404 error for not fiinding the files it needs.
Landing page:enter image description here
Another Page:enter image description here
do you use gzip compression or such as it? if yes try to disable it, and make sure you have the right path
First, check that the file permissions are correct.
Also, if you have changed anything on your .htaccess files, overwrite them with the default ones: https://github.com/WordPress/WordPress
Also it's always a good idea to go to the permalinks page (/wp-admin/options-permalink.php) to update the links of all dependencies to the new URL.
I have configured a site using WP on my Development Server and now I have moved it to another server with new URL. I have changed URL in database as well. But, my menus are pointing to the OLD URL and I am getting a 404 error.
How can I change them?
Try to use some wordpress plugins to migrate your website between servers.
Duplicator is one of them.
https://wordpress.org/plugins/duplicator/
You will have to do minimum effort if you use some tools.
Make SQL dump, overwrite old domain, load dump.
Also checks configuration files & themes.
You probably forget some links in your database. Check the following fields:
In wp_options, options with the following option_name:
siteurl, home
In wp_posts:
Check all the guid values.
You need also to check that your .htaccess is using the correct RewriteBase.
If your menus are built from a special theme feature (not the default WP menu functionality), you may have some encoded string in wp_options that reflect the menu settings. If so check on this procedure.
I've migrated many Wordpress sites before, but now I'm having an issue I just can't seem to solve. Some, but not all of the links are not loading properly.
I'm migrating from local.dev to example.com/test.
In my database options, I have both options set to example.com/test.
I doubled checked the options in the WP backend, and they're example.com/test.
I've updated my permalinks.
All of the pages work, all of the links work, but a few references to images, etc do not - they're loading example.com/ instead of example.com/test.
I think it might have to do with the .htaccess file, because I can't update it from the FTP side. If I delete it and update permalinks, no .htaccess file is created. I don't have access to any server side overrides, only the files.
In my MAMP vhosts, I have SymLinks Override set to All, but I can't edit anything like that on the live host.
The links that aren't working are along the lines of $image = get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
but instead returns
http://www.example.com/wp-content/uploads/image.jpg.
Using bloginfo('wpurl'); returns http://www.example.com/test, and all similar ones return properly (site_url();, 'template_directory', etc.
In the end, the site is going to go on http://www.example.com without the subdirectory anyway, but I'm sure I have to get it to work properly to prevent future errors.
I also updated to the newest version of Wordpress at some point, not sure if that could cause any issues.
I believe the issue deals with media and links placed in content items.
I use to do some manual SQL queries to fix this but now I run this plug-in https://wordpress.org/plugins/automatic-domain-changer/
The plug-in will go through all the content and make the needed changes.
The links that aren't working are along the lines of $image => get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
this meta information is stored in the DB. then to make the migration you have to change all the old URL in the DB before to import it in the new place
I need mention that I had google search the solution before post at here.
I move my wordpress site to another domain and different server.
wp_config.php edited; database, database username, passwword, and host all changed. table_prefix remain the same because i use the same one.
wp_posts and wp_option i had changed too.
I still got this error message anyway.
You do not have sufficient permissions to access this page
Anyone know what happen and how to fix this ?
wp-admin can't access after moving
If you are moving your domain without changing the Home and Site URLs of your WordPress site you can follow the below guidelines as prescribed by the wordpress codex.
If database and URL remain the same, you can move by just copying your files and database.
If database name or user changes, edit wp-config.php to have the correct values.
If you want to test before you switch, you must temporarily change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar).
If you had any kind of rewrites (permalinks) setup you must disable .htaccess and reconfigure permalinks when it goes live.
EDIT (if your site url has also changed, well i am only phrasing from the codex site)
Moving a website and changing your domain name or URLs (i.e. from http://example.com/site to http://example.com, or http://example.com to http://example.net) requires the following steps - in sequence.
Download your existing site files.
Export your database - go in to mySQL and export the database.
Move the backed up files and database into a new folder - somewhere safe - this is your site backup.
Log in to the site you want to move and go to Settings > General, then change the URLs. (ie from http://example.com/ to http://example.net ) - save the settings and expect to see a 404 page.
Download your site files again.
Export the database again.
Edit wp-config.php with the new server's mySQL database name, user and password.
Upload the files.
Import the database on the new server.
When your domain name or URLs change there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.
If you do a search and replace on your entire database to change the URLs, you can cause issues with data serialization, due to the fact that some themes and widgets store values with the length of your URL marked. When this changes, things break. To avoid that serialization issue, you have two options:
Only perform a search and replace on the wp_posts table.
Use the Search and Replace for WordPress Databases Script to safely change all instances.
Make sure that the web server is allowing you to view the page itself, and look in the httpd.conf or .htaccess file for the directory that the main Wordpress script lives in.
Make sure that the Wordpress files have the correct permissions. If you just copied them over, then the user that needs to accesses them (apache on many typical LAMP installs, but yours may be different) is able to.
If you have already copied all your files and moved all of it to the new directory, then all you need to do is set your site url, home url.
So for example, if you are working on wordpress locally, you might have had your original URL to something like this:
http://localhost/wordpress
and your new URL might be something like this:
http://wordpress.local
In the case above, you would need to modify your settings in the database.
Database settings:
Go to the wp_options table, and look for the column named option_name, look at the field that says siteurl and home. You will notice that next to them in the option_value field you had your old URL. Change this to your new URL, and you should be good to go.
Hope this helps.
I am trying to move a WordPress site from my local server to the online server.
The problem is that, after the migration, if I try to open the administration page (wp-admin) I only obtain a white page, as you can see here: http://scorejava.com/wordpress/wp-admin/. Everything else seems work well in the homepage: http://scorejava.com/wordpress/.
In my local web server I have the WP site into the folder: /var/www/wordpress. I have moved it into a wordpress folder that is into my root directory of my online web server.
I have also import the local database into the onlyne database using MySql and then I have use the Search and Replace for WordPress Databases Script to change automatically all the http://localhost/wordpress occurrence into the database tables with http://scorejava.com/wordpress/.
There is an error on your site, and you need to find out what's happening.
WordPress URLs
When migrating WordPress sites where the URL changes, you will need to tell WordPress about the new URL. WordPress stores that information in the database, so if you're comfortable with that, you could find the correct entry in the wp_options table in your database and update its value.
I will show some fixes for standard WordPress installs (where the site URL is the WordPress root), but you may need to use different values for home and siteurl if you have a different setup.
Fix URLs via SQL
You will need to update the relevant fields in the DB, those being the entries of wp_options where the option_name is siteurl or home. You can find these fields using phpmyadmin, mysql-workbench, or another database management tool, or you can use the following query, changing the URL to be your own.
UPDATE `wp_options` SET `option_value`='http://www.myurl.com' WHERE `option_name` IN ('siteurl', 'home');
Fix URLs via wp-config.php
However, you can also do this via wp-config.php, which I find to be much more comfortable. Just open wp-config.php and add the lines:
// Site URLS (override DB settings)
define('WP_HOME','http://www.myurl.com'); //<-- NO TRAILING /
define('WP_SITEURL','http://www.myurl.com'); //<-- NO TRAILING /
Obviously you'll need to supply your correct URL.
It's possible that this is the only error you're having, and after adding those lines to wp-config.php, you will be able to log in and use your site normally.
Debugging WordPress errors
However, if you continue to experience problems, and any time you're working on developing a website, you will want to see error output. You can check your server logs for information about the errors, but you may find it more convenient for WordPress to simply display the errors in the page. To enable error display, change the following setting to true in wp-config.php.
define('WP_DEBUG', true);
Now WordPress will display any errors it encounters directly in the webpage. Be sure to change the setting to false for use on a production site.
Working with wp-config.php
This file will be located in the root directory of your wordpress installation. To make any of the changes mentioned here, you may either edit the file directly on the server (via ssh for example), or download the file with an FTP client, make your changes using a text editor, and upload the file again.
It's also a good idea to keep a backup copy before making any changes in case you break something while you're working.
References
You can read all about changing the WordPress site URL on the docs page.
Late To the party, I've experienced this recently and I managed to solve the issue. Here is what I've done.
Step 1: Set WP_DEBUG to true from the wp-config.php file
Step 2: I tried domain.com/wp-login.php instead of domain.com/wp-admin by this I was able to get atleast login form and some errors of Warning: Cannot modify header information - headers already sent by
Step 3: I've added ob_start(); in wp-login.php file after <?php in first line, of course to get me in for a while.
Step 4: This trick worked. I've disabled all the plugins, and errors are gone.
Step 5: Activated all the plugins one by one to find which plugin is causing error, So that I can fix the error in particular plugin. Like there was one plugin adding style before wp_enqueque_style so I set it to a function and hook it properly.
There were some minor errors too like deprecated functions. Its up to you whether you want to correct it or use alternate plugin.
And Don't forget to remove ob_start from wp_login.php file. The core files should not be changed.
Hope this helps someone like me.
Inside your settings for your WordPress dashboard there are two fields named "WordPress address (URL)" and "Site address (URL)". These are also known as the "Home" and the "Site URL" settings for your website. The values need to match the server you're actually running on.
If you can't get to the admin, you can use phpmyadmin, go into your database, find the fields kin the wp_options table, and make sure they reflect your domain.
It should be enough in most of cases.
I've fought the dreaded "White Screen of Death" myself a few times. You can browse the threads at the Wordpress Support Site to glean some suggestions, or Google it for lots and lots of people's stories and advice dealing with these. I can't recommend a single, authoritative reference for this.
In most of my cases it was caused by whitespace after a closing ?> tag that got introduced because of changes in newline schemes between my dev and production servers, usually in a plugin.
You might also try putting Wordpress into debug mode or adding error_reporting(E_ALL); to the first line of your site's /wp-admin/admin.php file to see if these give you any hints.
I've personally been able to avoid these (touch wood) by using the XCloner plugin to make transfers between my Win dev machine and *nix production server.
Edit wp-content/themes/active-theme-folder/function.php and add this code just before:
<?php
define('WP_HOME','http://www.myurl.com'); //<-- NO TRAILING /
define('WP_SITEURL','http://www.myurl.com');
Add the below line into the wp-config.php file:
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME']);
define('WP_SITEURL', WP_HOME . '/');
In you wp-config.php file just above the line stop editing line add this line:
define('RELOCATE',true);
/* That's all, stop editing! Happy blogging. */
Then go to your login URL, refresh the page and log in.
IMPORTANT: If you can log in, then remove the RELOCATE line before preceding any further. Then navigate to:
Settings > General
Set your Wordpress URL and Site address to the correct locations:
WordPress Address (URL): http://example.com/wordpress
Site Address (URL): http://example.com/myblog
Press "Save".
In many cases when migrating files to a different server this issue arises simply because of a minor error in one of your PHP files. The error is additional characters after the closing?> PHP tag in the file. These may just be simple whitespace or returns but they can often be the cause of the white screen of death.
A primary culprit is the functions.php file in your WordPress theme. Take a look at it in a plain text file editor (often available with most hosting accounts) and ensure you delete any lines after the closing tag.
If it's not in this file use error reporting to identify the culprit file, it may be in a plugin or another file in your theme.
As mentioned by Jon Surrell enable error display, change the following setting to true in wp-config.php.
define('WP_DEBUG', true);
I had the same problem after migrating to a local server.
A first attempt failed because there were many hardcoded filepaths in the database.
So I tried again and took care to create the same path as on the live server and the same hostname and databasename. Now the website was good but wp-login gave a white screen.
With wp-debug I found that the problem was caused by wp-super-cache plugin that had a full filepath hardcoded in the config.php
Changing this path to the full local path did the trick.
These are the steps I usually follow.
Upload files and database.
Set the correct file permissions.
Update the database configurations in the wp-config.php file to match the server db login.
Update the wp_options table for updating the site url and home url.
If everything goes well you should be able to login to the admin using the wp-login.php as the url.
The first thing next to do is to go to the permalinks and click save it will automatically update the .htaccess file. If there is no write permisson it will show you can copy it and edit the file via ftp.
Next thing you can easily update all the urls safetly with a plugin named velvet urls . Using it for many years. It will update all other urls in the database.
All these steps will be enough if everything goes correctly.
If you get a blank page or something you can turn on the error reporting and write the logs from the wp config file itself. You can try some of these to debug.
Just remove plugins from the folders one by one.
Remove the custom theme which you are using.
Unless you edited the core files mostly it will solve the issue. Only other chance is the version mismatch for php or mysql that is also very important thing to note while migrating. Hope this helps someone.
I'm adding this answer to the fray, in the hope, it might help somebody else. I followed all of the advice above to no avail. I actually had to hack the PHP files to force my administrator to have access to the panel. It's through the panel that I discovered that my administrator account was not assigned the administrator role.
This is my hack to "wp-includes/capabilities.php"
function current_user_can( $capability ) {
$current_user = wp_get_current_user();
if ( empty( $current_user ) ) {
return false;
}
return true; // HACK to get superuser power to any logged in user
$args = array_slice( func_get_args(), 1 );
$args = array_merge( array( $capability ), $args );
return call_user_func_array( array( $current_user, 'has_cap' ), $args );
}
This allowed the Administrator Panel to appear, with access to https://example.com/wp-admin/users.php and then I could assign the role. I then unhacked the capabilities.php to ensure all users had the correct rights, now that I had "Administrator" assigned to me.
everyone. A few days ago I ported by BlogVault the WordPress multisite instance. The process went smoothly, the sites worked as needed. But I could not get into the console, allways got the error "Your browser does not support cookies, please enable them and try again". I spent several days researching and figured out that the error occurs due to an entry in the code of the page "wp_options".
The original site uses the line
define ('COOKIE_DOMAIN', strtolower (stripslashes ($ _SERVER ['HTTP_HOST'])));
but the new server uses the line
define ('COOKIE_DOMAIN', mydomain.com);"
Replacing lines of code solved the problem. Hope this help somebody)
It's maybe a late replay, but hope it will help someone else.
In my case here are steps I used to resolve the issue.
Edit the wp-config.php file from your WordPress project root and change define('WP_DEBUG', true); instead of false.
Upload the same file to the project root for the new server.
Try to log in same as previously like www.yourDomain.com/wp-admin - Hope now you are able to login the backend admin
Go to settings -> Permalinks - under common settings - choose the radio button plan then click SAVE button for a sake, then again choose day and name SAVE again, don't forget to click save, got back your domain and check your site, the inner pages should work perfectly fine.
Go back to wp-config.php and revert the value to false and upload again.
That's it.
I am not a wordpress developer but the above solution was perfectly fine for me and didn't find anywhere it's explained properly.