# Remove "Publish with Ghost" button on portal

**URL:** <https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817>\
**Category:** Developer help\
**Created:** [March 17, 2021, 6:49am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817 "2021-03-17T06:49:19Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Gunjal](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/saurabh_gunjal/32/8772_2.png) [@Saurabh\_Gunjal](https://forum.ghost.org/u/Saurabh_Gunjal)\
**Post date:** [March 17, 2021, 6:49am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/1 "2021-03-17T06:49:19Z")

</div>

How do we remove the “Publish with Ghost” button from the portal screen?

It should be optional and not default without an option to remove it. I really hope this is addressed in the next release.

---

<div class="post-metadata">

**Author:** ![rajeshtaylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rajeshtaylor/32/16716_2.png) [@rajeshtaylor](https://forum.ghost.org/u/rajeshtaylor)\
**Post date:** [March 17, 2021, 2:07pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/2 "2021-03-17T14:07:32Z")

</div>

It is still optional. I upgraded from 3 to 4.0 today and the process looks the same.

From the admin dashboard: Go to Email Settings.  
 ![Screenshot 2021-03-17 at 14.03.09](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/e/e972a100032c586aaa45147dbf29df6530f8c0ca.png)  
Then click on Customize. On the bottom left there’s a toggle button to switch on/off the Ghost Promote option.  
 ![Screenshot 2021-03-17 at 14.04.04](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/3/3c77f06cebe65e3f9ccc70d05541dd5c4cb7f67a.png)

---

<div class="post-metadata">

**Author:** ![Saurabh\_Gunjal](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/saurabh_gunjal/32/8772_2.png) [@Saurabh\_Gunjal](https://forum.ghost.org/u/Saurabh_Gunjal)\
**Post date:** [March 17, 2021, 3:24pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/3 "2021-03-17T15:24:21Z")

</div>

That is for the email design.

I’m referring to the button on the bottom left when you click on the portal button.

---

<div class="post-metadata">

**Author:** ![rajeshtaylor](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rajeshtaylor/32/16716_2.png) [@rajeshtaylor](https://forum.ghost.org/u/rajeshtaylor)\
**Post date:** [March 17, 2021, 4:57pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/4 "2021-03-17T16:57:48Z")

</div>

Ahh… apologies, I haven’t turned the portal feature on. Am going with the older method and using the theme. I added your query along with my own questions to Support and will update your thread soon.

**Update** : It’s not yet possible to disable the button from the Portal interface yet. But feedback to the Ghost team has been forwarded for consideration.

---

<div class="post-metadata">

**Author:** ![thebear.dev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thebear.dev/32/13956_2.png) [@thebear.dev](https://forum.ghost.org/u/thebear.dev)\
**Post date:** [March 23, 2021, 6:52am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/5 "2021-03-23T06:52:28Z")

</div>

Until there’s an official fix for this, I am playing around with the JS and CSS tied to this. The link seems to be global. Have you tried using your theme to hide it? Example: .gh-portal-powered, .gh-portal-powered a{display:none!important;}

---

<div class="post-metadata">

**Author:** ![Saurabh\_Gunjal](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/saurabh_gunjal/32/8772_2.png) [@Saurabh\_Gunjal](https://forum.ghost.org/u/Saurabh_Gunjal)\
**Post date:** [March 23, 2021, 1:02pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/6 "2021-03-23T13:02:12Z")

</div>

I inserted your code in the code injection but it didn’t remove the button.

What other changes do I need to make?

Also what is the exact location of class=“gh-portal-powered” ? (Deleting that particular element from the file will work right?)

---

<div class="post-metadata">

**Author:** ![thebear.dev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thebear.dev/32/13956_2.png) [@thebear.dev](https://forum.ghost.org/u/thebear.dev)\
**Post date:** [March 23, 2021, 1:03pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/7 "2021-03-23T13:03:46Z")

</div>

Not sure. I believe it’s inside a JS file. Right-click and inspect and check.

---

<div class="post-metadata">

**Author:** ![JavowiecPL](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/javowiecpl/32/25482_2.png) [@JavowiecPL](https://forum.ghost.org/u/JavowiecPL)\
**Post date:** [April 20, 2021, 4:57pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/8 "2021-04-20T16:57:40Z")

</div>

Hello all,

I managed to override Portal (`portal.min.js`).  
I needed it for translation and to remove “_Publish with Ghost_” button on Portal.

This solution is for **self-hosted Ghost instance**. I don’t see any possibility to do it in Ghost Pro (I’ve switched to Digital Ocean droplet, so now I can override Portal).

## How to override and customize Portal

Check url of your Portal in  
`/var/www/ghost/versions/{version}/core/shared/config/defaults.json`  
(can vary on different Ghost versions). In my example it looks like:

```json
"portal": {
    "url": "https://unpkg.com/@tryghost/portal@~1.1.0/umd/portal.min.js",
    "version": "~1.1.0"
}

```

Open:  
`/var/www/ghost/config.{environment}.json`  
on your server and add:

```json
"portal": {
    "url": "/assets/built/portal.js",
    "version": "~1.1.0"
}

```

You’ll need to restart Ghost in order to see changes made in `config.{environment}.json`:

```bash
ghost restart -d /var/www/ghost

```

Additional information about `config.{environment}.json`:

> **[Configuration - Ghost Developer Docs](https://docs.ghost.org/config)**
>
> For self-hosted Ghost users, a custom configuration file can be used to override Ghost’s default behaviour. This provides you with a range of options to configure your publication to suit your needs.

Unminify the JS file from the url you had in your Ghost instance (in my example: [https://unpkg.com/@tryghost/portal@~1.1.0/umd/portal.min.js](https://unpkg.com/@tryghost/portal@~1.1.0/umd/portal.min.js)) with some online tool (google it: “unminify js online”).

Paste unminified JS to new `portal.js` file which should be creted under `assets` directory of your theme.

Remove code in `portal.js` responsible for adding “_Publish with Ghosts_” button on Portal:

```javascript
Dt.createElement(
	"div",
	{ className: "gh-portal-powered" + (tn(["preview"]) ? " hidden" : "") },
	Dt.createElement(
		"a",
		{
			href: "https://ghost.org",
			target: "_blank",
			rel: "noopener noreferrer",
			onClick: function () {
				window.open("https://ghost.org", "_blank");
			},
		},
		Dt.createElement(At, null),
		" ",
		Dt.createElement("span", null, "Publish with Ghost")
	)
)

```

or add translations if you want them. `CTRL + F` is your friend.

Make sure that your theme will compile `portal.js` into `assets/built/portal.js`.

## Casper Theme 4.0.4 example: `portal.js` compilation

The `portal.js` file can be created under `/assets/portal/portal.js`.

Then you need to modify `gulpfile.js`, so it will be compiled under `/assets/built/portal.js`.

Follow the below steps (everything should be done in `gulpfile.js`):

**[1]** Add:

```javascript
function portal(done) {
    pump([
        src([
            'assets/portal/*.js'
        ], {sourcemaps: true}),
        concat('portal.js'),
        uglify(),
        dest('assets/built/', {sourcemaps: '.'}),
        livereload()
    ], handleError(done));
}

```

after `function js(done)`.

**[2]** Add:

```javascript
const portalWatcher = () => watch('assets/portal/**', portal);

```

after `const cssWatcher`.

**[3]** Change:

```auto
const watcher = parallel(cssWatcher, hbsWatcher);

```

to

```auto
const watcher = parallel(cssWatcher, portalWatcher, hbsWatcher);

```

**[4]** Change:

```auto
const build = series(css, js);

```

to

```auto
const build = series(css, js, portal);

```

And that’s it! Enjoy your customized Portal :)

## Cloudflare cache issue

I had an issue where changes were not visible for [https://example.com/assets/built/portal.js](https://example.com/assets/built/portal.js) after Theme update.

I had to login to Cloudflare and go to: `Caching` → `Configuration` → `Purge Cache` → `Purge Everything` in order to see updated `portal.js`

## Real Ghost site example with Polish translation and without “Publish with Ghost” button

You can see it here: [https://javowiec.pl](https://javowiec.pl)

 ![obraz](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/3/3bc7e4966f42d5844fa25bdf498868ff48b26c1b.png)

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [April 20, 2021, 5:41pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/9 "2021-04-20T17:41:47Z")

</div>

@JavowiecPL **you _never_ need to modify `core/shared/config/defaults.json`**

Whatever you put in your `config.{environment}.json` will override anything placed in the core file.

---

<div class="post-metadata">

**Author:** ![JavowiecPL](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/javowiecpl/32/25482_2.png) [@JavowiecPL](https://forum.ghost.org/u/JavowiecPL)\
**Post date:** [April 20, 2021, 5:49pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/10 "2021-04-20T17:49:04Z")

</div>

@vikaspotluri123 thank you! I didn’t know it. This is even better 🙂

I’ve added your remark to the solution 🙂

---

<div class="post-metadata">

**Author:** ![amun](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/amun/32/8302_2.png) [@amun](https://forum.ghost.org/u/amun)\
**Post date:** [April 20, 2021, 9:26pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/11 "2021-04-20T21:26:37Z")

</div>

We are waiting for an update in which we can choose whether this text will be displayed or not.

---

<div class="post-metadata">

**Author:** ![JavowiecPL](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/javowiecpl/32/25482_2.png) [@JavowiecPL](https://forum.ghost.org/u/JavowiecPL)\
**Post date:** [April 20, 2021, 9:31pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/12 "2021-04-20T21:31:14Z")

</div>

@amun: Yes, I know. However, there are people who don’t want to wait. For example me 🙂

So, I’ve already overridden it. I’ll just switch to the official fix when it is available.

---

<div class="post-metadata">

**Author:** ![thebear.dev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thebear.dev/32/13956_2.png) [@thebear.dev](https://forum.ghost.org/u/thebear.dev)\
**Post date:** [April 21, 2021, 5:09am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/13 "2021-04-21T05:09:01Z")

</div>

I went with the `config.production.json` edit, pointing the `portal.min.js` file to my theme. Doing so allowed me to edit whatever I wanted (which is the official fix from Hannah on the Ghost team).

I also wanted to keep the “Publish with Ghost” button, but change its text and link and link target.

Your solution looks interesting though and it covers a broader area than mine. Thanks for doing it!

---

<div class="post-metadata">

**Author:** ![josephkman](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/josephkman/32/11149_2.png) [@josephkman](https://forum.ghost.org/u/josephkman)\
**Post date:** [April 21, 2021, 8:59pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/14 "2021-04-21T20:59:22Z")

</div>

My new goal in life is to pursue everything I want with as much vigour as @thebear.dev!

---

<div class="post-metadata">

**Author:** ![thebear.dev](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/thebear.dev/32/13956_2.png) [@thebear.dev](https://forum.ghost.org/u/thebear.dev)\
**Post date:** [April 22, 2021, 4:52am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/15 "2021-04-22T04:52:18Z")

</div>

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Jack\_Oakley](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jack_oakley/32/8649_2.png) [@Jack\_Oakley](https://forum.ghost.org/u/Jack_Oakley)\
**Post date:** [April 29, 2021, 12:06pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/16 "2021-04-29T12:06:27Z")

</div>

Any plans to add this to settings in ghost admin?

---

<div class="post-metadata">

**Author:** ![JavowiecPL](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/javowiecpl/32/25482_2.png) [@JavowiecPL](https://forum.ghost.org/u/JavowiecPL)\
**Post date:** [May 6, 2021, 2:35pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/17 "2021-05-06T14:35:20Z")

</div>

Just wanted to say that you can also clone this repository:

> **[GitHub - TryGhost/Portal: Drop-in script to add membership features in a...](https://github.com/TryGhost/Portal)**
>
> Drop-in script to add membership features in a Ghost theme - GitHub - TryGhost/Portal: Drop-in script to add membership features in a Ghost theme

and then:

 ![obraz](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/5/518fcd30d5e3ec5c22fb215ac4396aaf879fe9e1.png)

This way adding the translation/customization to Portal is even easier than working with unminified JS.

If you don’t have an access to `config.production.json` file, you can always check:

> **[GitHub - TryGhost/Lyra: A paid-members theme for Ghost](https://github.com/TryGhost/Lyra)**
>
> A paid-members theme for Ghost. Contribute to TryGhost/Lyra development by creating an account on GitHub.

which doesn’t rely on GUI from `portal.min.js` file.

You can check how Login/Subscribe functionality looks like here:  
[https://lyra.ghost.io/](https://lyra.ghost.io/)

---

<div class="post-metadata">

**Author:** ![jeremielondon](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jeremielondon/32/31714_2.png) [@jeremielondon](https://forum.ghost.org/u/jeremielondon)\
**Post date:** [May 20, 2021, 10:14am UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/18 "2021-05-20T10:14:48Z")

</div>

I understand ghost not been very keen in giving us ( Self host ) the option to remove the ghost credit, but why not adding it as a paid option ?

@John @Kevin @Kym Would you guys consider it ?

---

<div class="post-metadata">

**Author:** ![josephkman](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/josephkman/32/11149_2.png) [@josephkman](https://forum.ghost.org/u/josephkman)\
**Post date:** [May 20, 2021, 12:53pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/19 "2021-05-20T12:53:01Z")

</div>

I second…the “Publish with Ghost” is essentially an ad…and many people on Ghost/Substack rocketship are opposed to advertising…it’s sort of central

---

<div class="post-metadata">

**Author:** ![josephkman](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/josephkman/32/11149_2.png) [@josephkman](https://forum.ghost.org/u/josephkman)\
**Post date:** [May 20, 2021, 1:07pm UTC](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817/20 "2021-05-20T13:07:30Z")

</div>

@JavowiecPL and @thebear.dev : you have been pioneers in the field of removing “Publish with Ghost”, like the Watson & Crick of that…I’m a noob, but it seems to me that the most elegant solution would rest entirely within the theme and not rely on the portal.min.js file

It’s possible to add any JS you want to the theme and the docs provide all the data attributes that the Portal UI uses…I run Ghost 4.3.3 and have a member flow that doesn’t make any visible use of the Portal…the only advantage of the integrated Portal popups is that they are well designed…but at the end of the day, they’re just modal popups

So will you consider replicating the Portal UI, but without the Publish with Ghost ad…I’d be happy to contribute $100 to that and others might want it too!

[Next page](https://forum.ghost.org/t/remove-publish-with-ghost-button-on-portal/20817.md?page=2)
