Wrong CSS and JS paths after moving wordpress page - wordpress

i moved my wordpress website from domain-a.com to domain-b.com and changed the the WP_HOME and WP_SITEURL with define and the siteurl and home with update_option. I can access the page now but the css and js-files still links to the domain-a.com. What else can i do?
regards

Refer to codex Moving WordPress. Your database may have records that still refer to domain-a.com. There are several options listed for search/replacing safely. I usually use Better Search Replace. If you can't access the dashboard, you'll need to use a PHP script to update the database.
Hopefully you have backups in case things get really wonky!
You may also consider reviewing any theme or plugin files that you have customized (if you're using a child theme or have written a plugin yourself) to ensure that there are no hardcoded domains.

Related

Why my Wordpress website is showing nothing?

My Wordpress is only showing me the following in the picture "My First Heading" and "My First paragraph". I tried to add themes and customise it but it is not changing. Also, I have added another page and I made it as homepage of the website, but still it does not work. Besides I reset my whole website and nothing happened.
I do not have enough points to put a comment, so I will post here. It is not possible to give a straight-forward answer to this, since there may be many reasons why this is showing. Here are some general tips that may help:
Check via ftp if your root directory contains any index.html files. If yes, remove them. WordPress uses index.php to load.
Go to WP Admin and switch off all plugins.
Turn on the default WordPress theme (Twenty Twenty or Twenty One, depending on your WordPress version)
Contact your host (send a ticket)
If none of this work, create a full site backup, then reinstall WordPress (make sure there are no other files on your server that can mess with the installation)

Malicious link added to website in wordpress

So I have a wordpress website that has a malicious link being added in the navigation of my site but when I log in it disappears and I can find no trace of it in the code at all. I am wondering if anyone has had this issue before and how they took care of it.
First thing to do is change to the default twentyfifteen or twentyfourteen theme and disable all plugins and see if the link is still there. If it's not, reactivate your theme and see if the link returns. If it does, it's from the theme; the theme is either hacked (see below) or it's a free (or junk) theme and the author added the link.
If the theme is not adding the link, reactivate plugins one at a time to see which one may be adding the link.
Depending on above: this sounds like you got hacked. Time to fix it right the first time, or you will get hacked again. You need to replace all core WP files/folders (except wp-config.php and wp-content), but scan the uploads folder and theme for exploit code and modified files or added files, comparing to a copy of your original theme. Replace all plugins, too.
Also scan the database for eval code and added administrators. (See "My Site was Hacked" below).
Change all host, FTP and WordPress passwords in the process. Scan your own PC for malware that might have grabbed logins and passwords.
Tell your web host you got hacked; and consider changing to a more secure host.
Carefully follow FAQ - My Site Was Hacked at WordPress.org.
Then take a look at the recommended security measures in Hardening WordPress and Brute Force Attacks at WordPress.org.

I made a bunch of wordpress sites for clients and built off of the core theme (I didn't use a child them). What are my options now?

I didn't know about the best practice of not skinning/modifying/working off of the core wordpress theme (twenty-ten, twenty-eleven, twenty-twelve, twenty-thirteen), and a bunch of my clients sites are running right now on the core themes with a custom/modified skin.
I've heard stories of wordpress getting hacked and sites being compromised because wordpress is out of date. The wordpress team also pretty much states that security issues are being fixed with each update. I need to update the core wordpress files on these sites to prevent this, but now I'm scared that if I update wordpress, the theme will be overwritten.
In fact, I had a client click the update button once in the wordpress admin (not really knowing what they were doing) and overwrite the theme (that was pretty disasterous). I even use a plugin now to disable that message so my other clients don't do that.
What steps should I take now to fix this? Copy the theme, rename the folder/theme name in style.css, and change the theme in admin settings? Would I be OK to update wordpress after I do this? Or are there more steps that I need to take?
You have the right idea. Copy the theme folder and rename the new copy to something else like customtheme. Then edit customtheme's theme info in the comments at the top of style.css and switch to it in the admin panel. After that you are safe to update.
Do keep in mind that it's possible WP updates will break things anyway, depending on how you implement custom functionality and what plugins you are using.
Agree with the above. Don't go anywher near the WP core or the default themes. Either create child themes or better off, build your own.
Copying and renaming and existing theme will cause you all sorts of problems as each theme uses named functions. If you just rename the stylesheet there will be more conflicts than you can fix in a week of debugging.
If you are blocking the update messages you are putting your clients at risk.

Fixing locally hosted wordpress site for migration (removing localhost)

A Wordpress novice and have set up my site locally using MAMP.
Unfortunately all the links to styles and I assume the database etc are by default pathed using 'localhost' so the site works ONLY on my machine. What is the correct way to change this pathing so that wordpress will correctly display the site?
For the database, you can edit the wp-config.php file at the root of your site.
As far as your styles are concerned, you'll have to go through the theme files that you've setup and adjust the relative path to those style sheets.
There are several options. Kyle is correct about editing wp-config.php, that will definitely take care of the new DB connection. However, I would advise against a manual adjustment of stylesheets and markup if possible. The easiest way for a novice might be this: export the DB from your local installation using "Settings > Export." Then, in your remote installation, use the WordPress Importer and it should tidy up all the links for you. This has worked for me several times.
You can learn more about other options here: http://wp.tutsplus.com/tutorials/hosting/how-to-break-a-wordpress-install-and-fix-it-again/
UPDATE: unless of course you've hardcoded "localhost" in your stylesheets and markup. In that case, use one of the solutions in the above link.
If your theme uses serialized data, you might have a problem when moving your website by simply doing a find and replace and changing the URL that way. I would recommend following WordPress's guide when you're moving your site.
http://codex.wordpress.org/Moving_WordPress
It involves using a special script to change the URL of your site.

wordpress theme doesn't appear

I'm having a very basic problem: I'm trying to create a new theme for a wordpress installation locally on my computer.
I've created a styles.css and index.php file and put it in a folder in wp-content/themes. But it doesn't appear in the Wordpress themes page.
As a test, I made a change to the description of one of the existing themes (Twenty-Ten) in its style.css, and refresh the Wordpress themes page, but the old description continues to be shown. This suggests to me that I'm simply using the wrong folder, but that's not possible! Any ideas on this problem much appreciated.
UPDATE: In fact, even when I delete Twenty Ten from the Themes folder, it's still available as an option in the Wordpress backend, and I can activate it... Very strange...
G
I agree with your diagnosis. You are either looking at the wrong folder or in fact the wrong computer. There's no other way that you could change the theme to one that has been deleted.
I suggest that you confirm you are in the same universe you think you are in. Create a simple file localserver.txt in your WordPress directory and then confirm that you can access that file.
If you can't, you have your answer. You are somehow accessing a different location.
If you can access that text file, you need to go further and look to see if something like the site url setting is redirecting you to the live site, without you realizing it, when you access wp-admin.
Beyond that, I'd need to know more about your setup. Something like having www.example.com in your /etc/host file and not example.com can cause similar confusion...
Are you using Wordpress Multisite?
In that case you have to 'enable' that theme in the Network admin manager

Resources