Paginate Pages by only showing 3 pages at most

Check the mid_size parameter in paginate_links

mid_size: How many numbers to either side of current page, but not including current page. Default 2.

So set it to: 'mid_size' => 1

Also you probably don’t want to show the first and last page, so set it to 0 (it’s 1 by default): 'end_size' => 0

Hope this helps.

EDIT:

It seems like the end property does not hide the last element. The easiest way is to hide it is using CSS:

.dots ~ .dots + .page-numbers { display: none; }

Otherwise, to remove the actual output from the function you would need to tweak it. You can return an array changing the type argument, loop through the elements and remove the one you are not interested in.