WordPress image URLs have a blank space before /wp-content - wordpress

I have run into a WP site which is not loading almost all images. The developer tools console shows 100s of these errors.
Failed parsing 'srcset' attribute value since it has an unknown descriptor.
Dropped srcset candidate "https://domain.tld"
After looking at the source code of the page, I found that the image URLs have a space before /wp-content/
This is happening for all src and srcset URLs.
I have tried troubleshooting by deactivating all plugins, but it did not fix the problem.
How do I go about fixing this issue?

The issue is that siteurl and home setting have a space at the end. The setting can either be found in wp-config.php file or in the database. I had to run the following command to fix it (replace https://example.com with the name your domain)
UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_name` = 'siteurl';
UPDATE `wp_options` SET `option_value` = 'http://example.com' WHERE `wp_options`.`option_name` = 'home';
You might find the following lines in wp-config.php:
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
Make sure they don't have a space at the end

Related

Wordpress home address in magento is giving 404 error

I have integrated WordPress into my Magento 2 application using Fishpig. I have changed WordPress home address as sitename/m4blog.
In my local http:localhost/sitename/m4blog is working fine. But when I deployed same thing to server, then getting 404 error. In server the url is https://sitename/m4blog. I have checked the perma links settings. Beow Permalinks settings it is like this
If your .htaccess file was writable, we could do this
automatically, but it isn’t so these are the mod_rewrite rules you
should have in your .htaccess file. Click in the field and press
CTRL + a to select all.
After this there is code for .htaccess. So I replaced my .htaccess in server with this code . But no use. Could anybody help me out to resolve the issue?
First way
Set your WordPress setup folder name "wp".
M2 Admin Menu > WordPress > Path = wp
Database: magento2_wp > Table: wp_options
option_id = 1
option_name = siteurl
option_value = http://www.example.com/wp //Folder name of your WordPress installation.
autoupload = yes
option_id = 2
option_name = home
option_value = http://www.example.com/blog //Frontend URL
autoupload = yes
Second Way
Go to wordpress folder most probably inside root.
edit .htaccess and paste a code you display on admin
Save it.

Can't access WP-Admin page because of error

I am trying to edit a website I made in Wordpress, but when I go to the example.com/wp-admin/ to get to the Admin,
I get the errors, and so there is no way to go into Wordpress to edit the site.
I even changed the WP Theme back to the default TwentyTen through PHPMyAdmin, but that didn't help.
What can I do? Here is what I get when I try to go to wp-admin page:
Notice: register_uninstall_hook was called incorrectly. Only a static
class method or function can be used in an uninstall hook. Please see
Debugging in WordPress for more information. (This message was added
in version 3.1.) in
/home/content/80/13163980/html/ybk/wp-includes/functions.php on line
3547
Notice: Undefined index: page in
/home/content/80/13163980/html/ybk/wp-content/themes/rt_infuse_wp/functions.php
on line 45
Notice: Undefined index: page in
/home/content/80/13163980/html/ybk/wp-content/themes/rt_infuse_wp/functions.php
on line 55
Warning: Cannot modify header information - headers already sent by
(output started at
/home/content/80/13163980/html/ybk/wp-includes/functions.php:3547) in
/home/content/80/13163980/html/ybk/wp-includes/pluggable.php on line
1178
I just set WP_DEBUG mode to false and that skipped it all and got me to the WP-Admin login page.
Just find the pluggable.php and after <?php please add this ob_start(); and save. That should work.
Warning: Cannot modify header information - headers already sent by
Removing "blank lines" from function.php file and check it now issue is as it is than after check plugin folder >> disable plugin and check
Refresh your Browser, and the original error message Should go away.

unable to access wp-admin after change theme on wordpress

i cannot access wp-admin, and i search on internet and it suggest me to delete the first blank space on file function.options.php, but there it not blankspace. how should i do ?
Warning: Cannot modify header information - headers already sent by
(output started at
/home/voalahui/public_html/wp-content/themes/rebound/admin/functions/functions.options.php:1)
in /home/voalahui/public_html/wp-includes/pluggable.php on line 1207
when i open function.option.php
<?php
add_action('init','of_options');
if (!function_exists('of_options'))
line 1 there is not blank space to deleted
so, i reupload again my file to hosting, and make sure there is not file who failed, and it's fixed

WP from remote to local

I really hope you can help me!
I need to make some changes on a WP website from Xampp on my mac.
I did the backup of the DB and via FTP I copied all the files in XAMPP/htdocs/b
I modified the wp-config.php as follow:
define('DB_NAME', 'db:name');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
after importing the DB I also changed the siteurl under wp_options.
Now my problem is this... wen I open the website no pictures loads and any link goes to /xampp/ folder
I tried so many things but nothing seams to work. I cannot even access the wp-login.php due to user and psw wrong.
please please help!
* I realise that img url is: img src="/wp-content/themes/nm/images/common/impcontent/mapfiller.jpg" so it looks for the imgs into the localhost/wp-content/... insted of localhost/b/wp-content/... how do I change that???
In wp-config.php set the following values to your proper values:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Once this is working, install and run https://wordpress.org/plugins/velvet-blues-update-urls/ to fix the path issues.
Execute the following query in phpmyadmin, note: wp_ is prefix of table. If you have changed the prefix of the table at the time of installation then use that prefix with wp_ in the below query
UPDATE wp_options SET option_value = replace(option_value, 'old_domain_url_here', 'new_domain_url_here') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'old_domain_url_here', 'new_domain_url_here');
UPDATE wp_posts SET post_content = replace(post_content, 'old_domain_url_here', 'new_domain_url_here');
Try using https://github.com/wp-sync-db/wp-sync-db
Install it both on localhost and on remote. Follow the instructions, set correct domains and push from local to remote. It should work nice :)

Wordpress: Cannot login in after upgrade - redirects to blank page

I updated a clients Wordpress to 3.5.2 and now cannot login via wp-admin.
The login form appears but once I hit the Log In button I am just redirect to a blank page with a single . on it. Same happens if I enter the wrong password.
I have checked out the Login Trouble Codex and tried replacing the wp-login.php file and disabling all plugins to no affect. I get the same issue occuring.
Front of the site seems fine.
What appreas in debug:
Warning: Cannot modify header information - headers already sent by (output started at /home/stretton/public_html/fo/wp-content/themes/freya/lib/widgets/banners-125.php:13) in /home/stretton/public_html/fo/wp-login.php on line 369
Warning: Cannot modify header information - headers already sent by (output started at /home/stretton/public_html/fo/wp-content/themes/freya/lib/widgets/banners-125.php:13) in /home/stretton/public_html/fo/wp-login.php on line 381
EDIT: I have also tried:
Renaming my theme to defualt it to the twentytwelve theme
Renaming the plugins directory
Removing the widgets directory
Replacing WP-Admin with from a fresh download
No luck with these either
Rename the active theme and force a revert to twentytwelve. Theme issues can still sometimes cause admin errors. But once the theme reverts, you should be able to get into admin, even if the front end is white-screened.
To figure out what's causing the white screen on the front end (or, if needed, the backend, too) use Debug. See https://codex.wordpress.org/WP_DEBUG
Add to wp-config.php:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
and the debug.log file will be in wp-content. And/or, add this line
define( 'WP_DEBUG_DISPLAY', true);
to dump them to the browser, too.

Resources