# Can we change the title of the topic without changing the slug?

**URL:** https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476
**Category:** Feature
**Created:** [18 يوليو 2016، 8:40م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476 "2016-07-18T20:40:29Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Idan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/idan/32/198212_2.png) [@Idan](https://meta.discourse.org/u/Idan)
#### Post date: [18 يوليو 2016، 8:40م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/1 "2016-07-18T20:40:29Z")

</div>

Can we change the title of the topic without changing the slug, at least for admin?

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [18 يوليو 2016، 8:50م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/2 "2016-07-18T20:50:05Z")

</div>

The old slug URL would still redirect to the article, is that your concern with the slug changing?

---

<div class="post-metadata">

### Author: ![Idan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/idan/32/198212_2.png) [@Idan](https://meta.discourse.org/u/Idan)
#### Post date: [18 يوليو 2016، 8:51م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/3 "2016-07-18T20:51:52Z")

</div>

No, I know that it will redirect, but I prefer not having redirection and just change the title, like in wordpress.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [18 يوليو 2016، 8:54م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/4 "2016-07-18T20:54:00Z")

</div>

ربما يحتاج ذلك إلى تسجيل في فئة #contribute:feature، فأنا متأكد تقريبًا من أن Discourse لا يسمح حاليًا بذلك.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 يوليو 2016، 9:14م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/5 "2016-07-18T21:14:46Z")

</div>

No this can not be done, slug is coupled to title.

---

<div class="post-metadata">

### Author: ![shri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shri/32/197750_2.png) [@shri](https://meta.discourse.org/u/shri)
#### Post date: [18 يوليو 2016، 10:11م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/6 "2016-07-18T22:11:25Z")

</div>

@sam does the old url then redirect to the new one? Concerned that if we allow high trust users to edit topics, we may end up sending visitors from old links to broken pages.

---

<div class="post-metadata">

### Author: ![Idan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/idan/32/198212_2.png) [@Idan](https://meta.discourse.org/u/Idan)
#### Post date: [18 يوليو 2016، 10:18م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/7 "2016-07-18T22:18:14Z")

</div>

Is the slug appears in the database? If so, there should be no problem allowing the admin at least to change the title. If the slug isn’t in the database, it is a problem.

---

<div class="post-metadata">

### Author: ![Idan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/idan/32/198212_2.png) [@Idan](https://meta.discourse.org/u/Idan)
#### Post date: [18 يوليو 2016، 10:19م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/8 "2016-07-18T22:19:45Z")

</div>

The old URL does redirect, it’s ID based and it checks if the slug is the same as the one in the databse or after normalization of the title. I blieve.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [18 يوليو 2016، 10:31م UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/9 "2016-07-18T22:31:30Z")

</div>

> [@Idan](#):
>
> Is the slug appears in the database? If so, there should be no problem allowing the admin at least to change the title. If the slug isn’t in the database, it is a problem.

The slug is cached, but but the source of truth is always the topic title. Quite a few internals need to be changed to allow overriding, not on any roadmap.

---

<div class="post-metadata">

### Author: ![stromfeldt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stromfeldt/32/223364_2.png) [@stromfeldt](https://meta.discourse.org/u/stromfeldt)
#### Post date: [20 مايو 2022، 1:17ص UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/10 "2022-05-20T01:17:19Z")

</div>

هل هذا لا يزال هو الحال؟

حالة الاستخدام الخاصة بي هي: تنشئ المنشورات على مدونتي Ghost مواضيع على Discourse. لقد اتبعت اقتراحًا ذُكر سابقًا من مؤسس Ghost لتقصير طول الـ slug، وهو ما فعلته مع أحدث منشوراتي. ينشئ Discourse الـ slug من عنوان المنشور، وليس الـ slug الخاص بالمنشور. بينما يعمل كل ذلك بشكل جيد، لدي أيضًا نص برمجي [discourse-get-comment-count](https://github.com/vikaspotluri123/discourse-get-comment-count) قيد الاستخدام يعرض على الصفحة الرئيسية (وكذلك في أعلى كل منشور فردي) عدد التعليقات التي يحتوي عليها كل منشور. المشكلة هي أنه يستعلم من Discourse (إذا كنت أستخدم المصطلحات الصحيحة) عن الـ slug الخاص بالمنشور، وليس عنوانه، وبالتالي لا يكتشف عدد التعليقات الفعلي. (يمكنك رؤية [المنشور في أعلى الموقع](https://ff2f.com/) لديه عدد التعليقات عالقًا على المؤشر الدوار.)

هل هناك أي شيء يمكنني فعله حيال ذلك بخلاف عدم تخصيص الـ slug؟

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [23 مايو 2022، 6:20ص UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/11 "2022-05-23T06:20:26Z")

</div>

هذا التنفيذ يجعلني 🤔

لماذا لا يستخدم `topic_id` هنا: [discourse-get-comment-count/update-comments.js at master · vikaspotluri123/discourse-get-comment-count · GitHub](https://github.com/vikaspotluri123/discourse-get-comment-count/blob/master/update-comments.js#L29)

إذا فعل ذلك، فلن يكون للـ slug أي أهمية على الإطلاق.

---

<div class="post-metadata">

### Author: ![stromfeldt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stromfeldt/32/223364_2.png) [@stromfeldt](https://meta.discourse.org/u/stromfeldt)
#### Post date: [23 مايو 2022، 6:45ص UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/12 "2022-05-23T06:45:53Z")

</div>

لن أدعي أنني أفهم هذا تمامًا، ولكن هذا ما قيل لي ردًا عند نقل اقتراحك:

> كيف يمكننا الحصول على topic\_id بناءً على معرف المنشور أو الاسم المستعار أو عنوان URL الخاص بـ Ghost؟
> 
> فهمي هو أنه يمكننا استخدام معرف المنشور لربط الموضوع عبر خاصية `external_id`، ولكن يبدو أن استخدام external\_id يقتصر على واجهة برمجة التطبيقات (API)، ويتم إنشاء الموضوعات باستخدام ميزة التضمين (embed)، (والتي لا يبدو أنها تدعم external\_id).

كملاحظة جانبية، على عكس ما ذكرته في تعليقي السابق، قمت بتعديل الاسم المستعار مرة أخرى إلى قيمته الافتراضية في منشور Ghost المذكور أعلاه قبل بضع ساعات، مما يعني أن عدد التعليقات ليس عالقًا على المؤشر الدوار كما ذكرت.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [24 مايو 2022، 4:53ص UTC](https://meta.discourse.org/t/can-we-change-the-title-of-the-topic-without-changing-the-slug/47476/13 "2022-05-24T04:53:40Z")

</div>

إذا كنت تعتمد على تضميننا، فإن Discourse يحتفظ بخريطة بين عنوان URL للتضمين والموضوع.

لذلك، يمكنك استخدام:

> <https://github.com/discourse/discourse/blob/2cc9f0e7d97237b7f6f53496e2554430473b8578/app/controllers/embed_controller.rb#L130-L131>

للحصول على قائمة بعدد التعليقات.

يمكن لـ “الحصول على عدد التعليقات” استدعاء هذا الـ endpoint باستخدام عنوان URL الوهمي. من الممكن إنشاء نقطة نهاية “دفعة” حتى تتمكن من تمرير عناوين URL متعددة إليها. #pr-welcome بشأن ذلك.
