# Cannot add child site on a non standard port

**URL:** <https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977>\
**Category:** Bug\
**Tags:** manage-sites\
**Created:** [December 1, 2023, 11:29pm UTC](https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977 "2023-12-01T23:29:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgourlay](https://community.mainwp.com/user_avatar/community.mainwp.com/kgourlay/32/2040_2.png) [@kgourlay](https://community.mainwp.com/u/kgourlay)\
**Post date:** [December 1, 2023, 11:29pm UTC](https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977/1 "2023-12-01T23:29:23Z")

</div>

Hi there, I am trying out running my MainWP dashboard on my local machine. It seems to work mostly, but I wanted to connect a new child site as a test, and I created that child site listening on port 8080. When I tried to connect the child site, I immediately got an error: "Connection test failed. Error message: Invalid URL.”

I tried a few different variations and noticed that no matter what the URL, it won’t accept it if it has a port specified. e.g. [sample.com](http://sample.com) works but [sample.com:80](http://sample.com:80) fails. To be clear, it’s not failing to connect (it doesn’t even get that far). Rather it fails to accept the URL at all.

---

<div class="post-metadata">

**Author:** ![bojan](https://community.mainwp.com/user_avatar/community.mainwp.com/bojan/32/3059_2.png) [@bojan](https://community.mainwp.com/u/bojan)\
**Post date:** [December 4, 2023, 7:58pm UTC](https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977/2 "2023-12-04T19:58:12Z")

</div>

Hi @kgourlay

The development team added a filter for other ports.

I will send you a pre-release version of the Dashboard via a private message.

After you install it, add this code snippet to the MainWP Dashboard (the easiest way is using our Custom Dashboard extension):

```auto
add_filter( 'mainwp_connect_sites_allow_ports', 'myhook_mainwp_connect_sites_allow_ports', 10, 1 );
function myhook_mainwp_connect_sites_allow_ports( $allows ) {    
    $allows[] = 8080;
    return $allows;
}

```

---

<div class="post-metadata">

**Author:** ![kgourlay](https://community.mainwp.com/user_avatar/community.mainwp.com/kgourlay/32/2040_2.png) [@kgourlay](https://community.mainwp.com/u/kgourlay)\
**Post date:** [December 4, 2023, 8:10pm UTC](https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977/3 "2023-12-04T20:10:26Z")

</div>

Wonderful, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://community.mainwp.com/uploads/default/original/2X/4/4cfc87ac67e4ebdbfa0bbf0b19c8657f35a29a5b.png) [@system](https://community.mainwp.com/u/system)\
**Post date:** [December 5, 2023, 8:10pm UTC](https://community.mainwp.com/t/cannot-add-child-site-on-a-non-standard-port/7977/4 "2023-12-05T20:10:57Z")

</div>

Closed on December 5, 2023, 8:10pm UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
