Unwanted center mark lines

Is there a way to add center marks that don't extend where they aren't needed?