Ask your WordPress questions! Pay money and get answers fast! (more info)

Images are not using the site url WordPress

  • SOLVED

Hi There,

We are using a Wordpress theme with the plugin Visual Composer.

When I upload an image and insert in a text area the src is cutting off the root domain.
Example: src="../wp-content/uploads/2013/10/plectrums.jpg"

Where it should be src="http://www.mysite.com/wp-content/uploads/2013/10/plectrums.jpg"

Anyone fancy having a look at this for me.

URL in screenshot.

Many Thanks

Answers (8)

2013-12-03

Fahad Murtaza answers:

Can you check your general settings if the site URL is correct.

WordPress Address (URL)
Site Address (URL)

In general settings. They should both point to site's root link.


Fahad Murtaza comments:

Looks some some custom plugin or filter is updating the image path. It shouldn't be relative at all. Can you try disabling plugins one by one and see if inserted images gets correct path. I am quite sure it has to do with a plugin or setting in your theme if not the WordPress Address (URL) and Site Address (URL) in gerenarl settings are correct and don't have a trailing slash '/'


Fahad Murtaza comments:

The issue was with the plugins. I narrowed down to visual editor. Its fixed now.

You just need to add the images again and it will insert the correct url i.e absolute one.

2013-12-03

zebra webdesigns answers:

Hello Jim

Can you provide the access to the site if possible

2013-12-03

Aezaz Shaikh answers:

Check if your site url and home url is not blank.
Goto settings-> general from backend and check home url and site url is not blank or wrong.

Hope this helps.

http://www.inmotionhosting.com/support/images/stories/wordpress/change-url/url-settings-in-wordpress-dashboard.png

2013-12-03

Balanean Corneliu answers:

The right place of images is here :
http://www.popcornlondon.co.uk/sites/newfuturegraphic/wp-content/uploads/2013/10/place-1112-wide.png


Balanean Corneliu comments:

http://www.popcornlondon.co.uk/sites/newfuturegraphic/wp-content/uploads/2013/

and now can be the folder /12/ i think if is like the other ones

2013-12-03

Arnav Joy answers:

which plugin you are using?

2013-12-03

akhilesh singh answers:

Hi jim
try to add this code in your themes function.php

function fix_relpath($the_content){
return str_replace('href="../', 'href="http://YOURDOMAIN.COM/', $the_content);
}
add_filter('the_content', 'fix_relpath');

replace YOURDOMAIN.COM with your domain name

this will show your images on your site.

2013-12-03

Hariprasad Vijayan answers:

Hello,

Make sure that your WordPress Address (URL) and Site Address (URL) are "http://www.popcornlondon.co.uk/sites/newfuturegraphic" from your dashboard.

2013-12-05

Vidyut Kale answers:

Check to see if you haven't got a plugin modifying urls to make them relative. Failing that, are these images from a migrated site? If yes, other things to try. Do update.