This study was a preliminary attempt to develop and examine an online pain management programme incorporating mindfulness‐informed exercises (i.e. breathing and body scanning exercises) and CBT elements for ankylosing spondylitis patients. Thirty patients diagnosed with ankylosing spondylitis participated in a five‐week online pain management programme, which was delivered primarily through a website. The materials covered by the website included breathing and body scanning exercises, mindful walking exercise, positive thinking and management of dysfunctional thinking. Each participant received instructions and reminders from a counselling psychologist through electronic communications each week. They completed the Brief Pain Inventory, Ryff's Psychological Well‐being Scale, Pain Self‐Efficacy Questionnaire, Pain Catastrophizing Scale and Cognitive and Affective Mindfulness Scale‐Revised before and after the treatment programme. In addition, four face‐to‐face focus groups were conducted to yield supplementary qualitative findings. The overall results indicate that this online pain management programme can improve sleep quality and reduce pain interference and catastrophic responses to pain in ankylosing spondylitis patients, albeit being not very effective for mitigating the intensity of pain. Moreover, male and female patients can benefit equally from the online programme. Findings from the focus groups revealed some challenges faced by local patients when practising mindfulness‐informed exercises. Some solutions to those challenges were put forward in accordance with patients’ feedback.