I have made "device of purpose" that fixes this behavior over time.
1) Laptop is for work only ( every thing else is blocked )
2) Mobile is for social media and procrastination ( I switch off internet while working. )
1) Laptop is for work only ( every thing else is blocked )
2) Mobile is for social media and procrastination ( I switch off internet while working. )
On my computer, I block all distracting sites with the extension I built until noon, then I have 20 minutes for mostly Twitter, then all blocked until 4PM, another 20 min break, and then blocked until 8PM. 8PM-midnight, I do whatever I want. I've found this a fair agreement with myself that I have no reason to break. It created a rhythm for me.
So perhaps if a complete block is too big a stretch, you can give yourself a couple well-defined "fun breaks".