# wordpress plugin cutting off base URL

**URL:** https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471
**Category:** Product Support
**Created:** [October 5, 2015, 12:55pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471 "2015-10-05T12:55:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![solidrockguy](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@solidrockguy](https://forum.mautic.org/u/solidrockguy)
#### Post date: [October 5, 2015, 12:55pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/1 "2015-10-05T12:55:10Z")

</div>

I have installed the wordpress plugin on v 1.0 from wordpress repository to my wp site running wp v.4.3.1 . I configure the plugin to target my main mautic installation but when I view the page source of a page it shows the full tracking url with the very last character cut off (in my case a “t” from a “.net” domain). The entire domain is 34 characters including the http://. The rest of the info from the plugin appears to be there with a big encoded string after the mtracking.gif file name. I have tried adding another character and an additional “/” to the end of the base mautic url to no avail. Any help is much appreciated.

---

<div class="post-metadata">

### Author: ![solidrockguy](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@solidrockguy](https://forum.mautic.org/u/solidrockguy)
#### Post date: [October 5, 2015, 12:55pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/2 "2015-10-05T12:55:10Z")

</div>

I have installed the wordpress plugin on v 1.0 from wordpress repository to my wp site running wp v.4.3.1 . I configure the plugin to target my main mautic installation but when I view the page source of a page it shows the full tracking url with the very last character cut off (in my case a “t” from a “.net” domain). The entire domain is 34 characters including the http://. The rest of the info from the plugin appears to be there with a big encoded string after the mtracking.gif file name. I have tried adding another character and an additional “/” to the end of the base mautic url to no avail. Any help is much appreciated.

---

<div class="post-metadata">

### Author: ![solidrockguy](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@solidrockguy](https://forum.mautic.org/u/solidrockguy)
#### Post date: [October 5, 2015, 1:02pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/3 "2015-10-05T13:02:26Z")

</div>

Interestingly enough - if I use the [mautic.com](http://mautic.com) url it works and does not cut off the last character

---

<div class="post-metadata">

### Author: ![solidrockguy](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@solidrockguy](https://forum.mautic.org/u/solidrockguy)
#### Post date: [October 5, 2015, 2:05pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/4 "2015-10-05T14:05:17Z")

</div>

My developer found the issue with the plugin. It has a .trim function that was cutting off the end of my url: $image = ‘ ![mautic is open source marketing automation]()’;  
removing the .trim function fixed it and it works fine now. I’m not sure why it does that because it should just trim spaces, etc but it was removing the final character in my url as well.

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [October 7, 2015, 6:26am UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/5 "2015-10-07T06:26:38Z")

</div>

The trim function is there for removing spaces and “/” because if your base URL would end with “/” then the URL to the tracking pixel would look like

```auto
http://somemautic.com//mtracking.gif
```

I’m not sure why it is stripping “t” as well. “t” should strip tabs, “nr” should strip new lines. At least that’s what I thought.  
Would your developer be so kind to submit a pull request fixing this issue?

---

<div class="post-metadata">

### Author: ![tiagorodrigues](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tiagorodrigues/32/476_2.png) [@tiagorodrigues](https://forum.mautic.org/u/tiagorodrigues)
#### Post date: [October 27, 2015, 1:40pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/6 "2015-10-27T13:40:08Z")

</div>

[edit] Found your PR @escopecz [/edit]  
This problem is still happening. I’ll fix it and send a pull request.

---

<div class="post-metadata">

### Author: ![jellederijke](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@jellederijke](https://forum.mautic.org/u/jellederijke)
#### Post date: [August 12, 2016, 9:37am UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/7 "2016-08-12T09:37:31Z")

</div>

I wrote an easy fix in another thread about this same problem. This might come in handy for other users:

I know this is a really old post, but perhaps you or other user could still use a sollution.  
For me this worked:  
(Joomla setup with Mautic plugin)  
Find file mautic.php in /plugins/system/mautic  
Make a copy, just to be sure  
Edit original en find code on line 102:  
$mauticUrl = trim($this-\>params-\>get(‘base\_url’), ‘tnrx0B/’);  
Change to:  
$mauticUrl = trim($this-\>params-\>get(‘base\_url’), ’ nrx0B/’);

(so remove the t)

Hope this helps out!

ps: I am no expert at coding whatsover. I just tried this and it works.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [February 2, 2020, 10:57pm UTC](https://forum.mautic.org/t/wordpress-plugin-cutting-off-base-url/2471/8 "2020-02-02T22:57:35Z")

</div>


