Current theoretical models of writing suggest that cognitive and motivational processes interact with each other during written production. However, despite the growing interest in motivational variables in writing, there are still few efforts to study them together with cognitive variables. Therefore, this study aimed to test the possibility that the cognitive processes of transcription and executive functions may be related to writing performance, through their link with the writing-motivational variables of self-efficacy and attitudes. For that, 157 Portuguese third and fourth graders planned and completed one opinion essay, performed transcription tasks, and completed motivation-related questionnaires. Furthermore, schoolteachers completed an executive function questionnaire about each student and provided their school grades. Results showed that motivation, specifically self-efficacy, did not predict Grade 3 and 4 writing performance. However, attitudes were predictors of written planning and text length. More specifically, attitudes and handwriting fluency contributed to text length just as attitudes and spelling accuracy contributed to written planning. There was no evidence of indirect effects from cognitive variables on writing performance via motivation variables. These findings provide original information on the links between cognition and motivation in writing, which may be useful to guide the teaching of writing. In line with effective instructional approaches to writing, current findings further support the importance of jointly targeting the cognitive and affective dimensions of writing.